Commit Graph

531 Commits

Author SHA1 Message Date
Ariel Mashraki
91c7fcc685 dialect/sql/schema: allow only table creation modification in automatic schema planning (#3660) 2023-07-26 11:24:33 +03:00
Ariel Mashraki
f0a81e2640 dialect/sql: add predicate to check hasprefix between columns/fields 2023-06-22 15:43:25 +03:00
Ariel Mashraki
0055559b1b dialect/sql: add tests to new logical predicate functions 2023-06-22 00:08:26 +03:00
Ariel Mashraki
808edd134d dialect/sql: support capturing predicates in selectors
This allows custom predicates mutating the root querying and still respect the AND/OR/NOT semantics
2023-06-22 00:08:26 +03:00
Ariel Mashraki
b49d5f5924 dialect/sql/sqlgraph: expose standard modifier to eager-load N neighbors (#3603) 2023-06-17 12:23:57 +03:00
Ariel Mashraki
a8851db571 dialect/sql/sqljson: inline boolean values (#3570)
Some drivers like mysql encodes them as 0/1
2023-05-29 17:15:32 +03:00
Ariel Mashraki
2924da5175 dialect/sql: expose the underyling builder of UpdateSet (#3541) 2023-05-16 00:00:56 +03:00
Ariel Mashraki
fc8d095da8 dialect/sql: add OrderByRand option (#3518) 2023-05-04 12:13:24 +03:00
Ariel Mashraki
f251400818 dialect/sql/schema: support passing schema diff options (#3516) 2023-05-03 11:28:10 +03:00
Ariel Mashraki
a792f429a6 dialect/sql/schema: allow ariga.io/atlas schema diff to be extended (#3514)
By not relying on the SchemaDiff signature, we allow the schema.Differ to be extended without introducing breaking changes to ent
2023-05-01 17:14:17 +03:00
Ariel Mashraki
bc7d8c936f dialect/sql/sqlgraph: replace id IN with EXISTS for HasNeighbors predicates (#3492) 2023-04-19 17:52:01 +03:00
Ariel Mashraki
8cb27bc7cf dialect/sql: add method for finding selection occurrences in queries (#3473) 2023-04-12 23:22:52 +03:00
Ariel Mashraki
44b8648720 dialect/sql/sqlgraph: allow query edge fields with alias (#3470) 2023-04-11 13:55:04 +03:00
Ariel Mashraki
36cd6a8a8b dialect/sql: skip formatting qualified columns (#3469) 2023-04-11 13:16:40 +03:00
Ariel Mashraki
5b1de3901a doc: update ordering fluent api (#3456) 2023-04-09 15:00:16 +03:00
Ariel Mashraki
064c9118b7 entc/gen: add fluent-api for order options (#3449) 2023-04-09 10:37:42 +03:00
Ariel Mashraki
02bb3269af dialect/sql: move order-by options to top-level driver package (#3446) 2023-04-07 00:35:20 +03:00
Ariel Mashraki
0e7203655e dialect/sql/sqlgraph: allow selecting order by terms (#3439) 2023-04-04 14:00:35 +03:00
Ariel Mashraki
4c332f7bba doc/features: add dynamic values support (#3436) 2023-04-03 17:55:28 +03:00
Ariel Mashraki
ba7f158a9c entc/gen: allow scanning dynamic sql values (#3432) 2023-04-03 17:07:24 +03:00
Ariel Mashraki
abafd91b2d dialect/sql: move columns check from codegen to sql package (#3431) 2023-04-02 13:57:21 +03:00
Ariel Mashraki
90289b7494 dialect/sql: additional predicate helpers (#3429) 2023-04-02 13:01:36 +03:00
Ariel Mashraki
27bc0470eb dialect/sql/sqlgraph: add Step helpers for edge types (#3428) 2023-04-01 21:34:42 +03:00
Ariel Mashraki
60bb939fc2 dialect/sql/sqlgraph: add function to order by edge terms (#3426) 2023-04-01 20:55:00 +03:00
Zhizhen He
6f847a3492 ci: add spell checker and fix existing typo (#3420)
* ci: add spell checker and fix existing typo

* chore: move typos.toml to .github

* fix: correct config file path
2023-03-30 11:38:29 +03:00
Ariel Mashraki
e3cee0adc2 dialect/sql/sqlgraph: add function to order by edge count (#3422) 2023-03-30 10:10:59 +03:00
Ariel Mashraki
651a2a166e dialect/sql: add Joined<T> helpers for Selector to avoid double joining (#3419) 2023-03-28 15:33:21 +03:00
Ariel Mashraki
427aaf7d45 dialect/sql: add Selector.HasJoins helper (#3418) 2023-03-28 14:31:43 +03:00
Ariel Mashraki
d9e7adfa05 dialect/sql/sqlgraph: catch SQLite INSERT errors executed with Driver.Query (#3415) 2023-03-27 22:21:47 +03:00
Ariel Mashraki
c35f786f86 entc/gen: ensure edge-fields are selected when their edges are loaded (#3401) 2023-03-20 19:11:04 +02:00
Ariel Mashraki
b340ed78cf dialect/sql: append selector alias only if defined (#3399) 2023-03-19 12:07:41 +02:00
Ariel Mashraki
3f1063c77e schema/field: add support or external ValueScanner (#3391) 2023-03-16 22:18:54 +02:00
Jannik Clausen
55e98b5b9b dialect/sql/schema: mock result in write driver if returning clause is present (#3369) 2023-03-07 10:43:01 +01:00
Jannik Clausen
809b22be7c dialect/sql/schema: strip returning from seed (#3367) 2023-03-07 07:46:34 +01:00
Ariel Mashraki
7e2da46e09 dialect/sql/schema: expand fmt.Stringer args in WriteDriver (#3366) 2023-03-04 23:05:16 +02:00
Ariel Mashraki
3b7715b552 dialect/sql/schema: allow setting table comments (#3365) 2023-03-04 20:50:26 +02:00
Ariel Mashraki
f16451eab8 dialect/sql/schema: allow planning with indentation (#3363) 2023-03-04 10:06:53 +02:00
Ariel Mashraki
bd6f26aa7c dialect/sql/schema: allow configuring Atlas to return ErrNoPlan (#3322) 2023-02-16 21:56:51 +02:00
Ariel Mashraki
4e05f76717 dialect/sql: minor changes to allow using Migrate externally (#3316) 2023-02-14 15:06:36 +02:00
Ariel Mashraki
4c87e262a6 dialect/sql/schema: use the Atlas as state reader (#3314) 2023-02-14 10:20:34 +02:00
blukai
349b950978 dialect/sql/schema: ensure consistency of NotCleanError (#3310)
* dialect/sql/schema: ensure consistency of NotCleanError

For https://github.com/ariga/atlas/pull/1454

* get rid of cerr var

https://github.com/ariga/atlas/pull/1454#discussion_r1102391750
2023-02-10 13:25:53 +01:00
Ariel Mashraki
939c7cff1a entc/gen: reduce the usage of DISTINCT in queries (#3305)
Most queries are not graph traversals but rather regular table scans,
in which case the DISTINCT clause is not needed as duplicates cannot be
returned (unless query was modified by the user).
2023-02-06 22:40:50 +02:00
Ariel Mashraki
8022271f12 entc/integration: add example for composite unique index (#3302) 2023-02-06 11:17:33 +02:00
Ariel Mashraki
0e6ef32505 dialect/sql/sqlgraph: add update spec builder (#3301) 2023-02-06 07:13:06 +02:00
Ariel Mashraki
92cc7438f7 dialect/sql/sqlgraph: add deletion spec builder (#3291) 2023-02-01 11:55:00 +02:00
Ariel Mashraki
037b5a4bc3 dialect/sql/sqlgraph: add builders to create spec (#3288) 2023-01-31 09:37:51 +02:00
Ariel Mashraki
433609444c dialect/sql/sqljson: support for order by value and length (#3278) 2023-01-26 12:20:31 +02:00
Pedro Henrique
604c4942a4 dialect/sql: improve support for subqueries (#3274) 2023-01-26 09:43:07 +02:00
Ariel Mashraki
7ed84a86a8 dialect/sql/schema: skip destructive table changes (#3253)
This will be fixed also in Atlas, but having this extra safety here feels safer
2023-01-19 15:33:17 +02:00
Ariel Mashraki
fa1cf83fdd dialect/sql/sqlgraph: ignore ORDER BY clauses in COUNT queries (#3226) 2023-01-10 14:03:29 +02:00