Ariel Mashraki
770bb0f1a2
entc/gen: merge generate config.go file with client.go ( #3319 )
2023-02-16 12:08:41 +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
baec350ed4
entc/gen: support type-based matching for edge-schema columns ( #3306 )
...
In case of no match by foreign-keys, we search by edge-type. This can happen if the type (edge owner)
is named T, but the edge-schema E names its edge field as u_id. We consider it as a match if
there is only one usage of T in E.
2023-02-07 10:58:20 +02: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
138bd2bc1d
entc/gen: <T>Query.IDs should not return duplicates ( #3304 )
2023-02-06 21:19:05 +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
cb2f75932f
entc/gen: change typo from Use to Intercept ( #3290 )
2023-02-01 11:43:17 +02:00
Ariel Mashraki
037b5a4bc3
dialect/sql/sqlgraph: add builders to create spec ( #3288 )
2023-01-31 09:37:51 +02:00
Ariel Mashraki
a0fad09539
entc/gen: remove unnecessary function from codegen ( #3287 )
2023-01-30 18:32:25 +02:00
Ariel Mashraki
d11122592a
entc/gen: add support for UpdateOne with predicates ( #3286 )
2023-01-29 13:09:16 +02:00
Pedro Henrique
56c16b25ef
entc/gen: allow setting UpdateDefault without Default ( #3276 )
...
* entc/gen: ensure UpdateDefault is generated
* apply suggestions from PR
* Apply suggestions from code review
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2023-01-26 18:09:09 +02:00
Ariel Mashraki
433609444c
dialect/sql/sqljson: support for order by value and length ( #3278 )
2023-01-26 12:20:31 +02:00
Ariel Mashraki
d66350ae40
entc/gen: add support for DeleteOne with predicates ( #3271 )
...
Also, fixed a bug in DeleteOne.Exec where it was skipping NotFoundError
2023-01-24 15:10:20 +02:00
sisterdong
c9445d2794
entc/gen: make interceptor works for eager loading m2m edges ( #3257 )
...
* entc/gen: make interceptor works for eager loading m2m edges
* entc/gen: make interceptor works for eager loading m2m edges
* entc/gen: fix indent
* entc/gen: go generate example
2023-01-23 15:42:08 +02:00
Ariel Mashraki
c5e08f20c1
doc/interceptors: document ent.QueryContext usage
2023-01-14 22:47:54 +02:00
Ariel Mashraki
ef0427550f
ent: add additional fields to QueryContext
2023-01-14 22:47:54 +02:00
Ariel Mashraki
236cd2920c
entc/gen: use consistent per-node client names ( #3233 )
...
Fixed https://github.com/ent/ent/issues/3230
2023-01-11 12:09:13 +02:00
Ariel Mashraki
b88f45aa78
entc/gen: skip executing sub-query for empty set of edges ( #3212 )
2023-01-07 08:54:18 +02:00
Ariel Mashraki
430114433a
entc/gen: explicitly import node packages in generate ent.go file ( #3209 )
...
Fixed https://github.com/ent/ent/issues/3208
2023-01-04 10:47:04 +02:00
Ariel Mashraki
542f36d4ab
entc/gen: skip checking required fields with db-based default values ( #3204 )
2023-01-02 22:59:27 +02:00
Ariel Mashraki
41bf915604
entc/gen: support setting default values/exprs for edge-fields ( #3203 )
2023-01-02 14:19:01 +02:00
Pedro Henrique
8307c2eaba
entc/gen: copies interceptors on Clone ( #3194 )
2022-12-28 06:29:48 +02:00
Ariel Mashraki
c868f4a174
doc: add entsql.WithComments annotation ( #3192 )
2022-12-26 16:56:49 +02:00
Ariel Mashraki
136807549d
dialect/entsql: supports setting SQL column comments ( #3191 )
...
* feat: Add column comment in SQL DDL, using EntSQL annotations to achieve it.
* Update annotation.go
* fix lint
* Add table primary key column comment
* entsql.Comment(string) is unnecessary
* entc/gen: minor changes to entsql.WithComments + add tests
Co-authored-by: chenghonour <wantto@outlook.com >
2022-12-26 14:48:37 +02:00
Ariel Mashraki
92bacc10e4
entc/gen: add typed traversers and interceptors ( #3182 )
2022-12-20 11:12:19 +02:00
Ariel Mashraki
34bd0b7b6f
entc/gen: move mutation hooks logic to a shared generic function ( #3180 )
2022-12-19 17:36:29 +02:00
Ariel Mashraki
68a4533574
entc/gen: use new sql predicates to reduce codegen size ( #3179 )
2022-12-19 11:40:39 +02:00
Ariel Mashraki
f226627d67
ent: export query interceptors ( #3157 )
2022-12-19 10:17:10 +02:00
Andy Day
63c123f36c
schema: add Comment annotation ( #3164 )
...
* Add schema.CommentAnnotation (resolves #3155 )
Adds new mechanism for customizing a model's godoc comment in code (via an Annotation).
* feedback
2022-12-10 23:30:45 +02:00
Ariel Mashraki
d0c5afa705
entc/gen: make generated client to implement the ent.Mutator interface ( #3161 )
2022-12-09 21:18:25 +02:00
Pedro Henrique
0f20a3d007
entc/integration: test with Postgres 15 ( #3152 )
2022-12-07 11:55:06 +02:00
Ariel Mashraki
381483e45c
entc/gen: remove unnecessary sqlgraph.To step on HasE predicates ( #3144 )
...
Predicate that checks existence-only do not need the 'other' table
2022-12-04 13:15:16 +02:00
Ariel Mashraki
f1205ce95f
entc/gen: remove driver specific implementation for Exist ( #3136 )
2022-12-01 17:39:52 +02:00
Ariel Mashraki
b6a475f066
entc/gen: skip generating edge-schema unique indexes if defined
2022-11-23 18:56:02 +02:00
Ariel Mashraki
2d980550db
doc/edges: document the new edges behavior
2022-11-20 17:37:08 +02:00
Ariel Mashraki
f46dd7ace8
dialect/sql/sqlgraph: add support for edge-schema in create-bulk
2022-11-20 17:37:08 +02:00
Ariel Mashraki
aa3d21f01a
dialect/sql/sqlgraph: changing the M2M creation semantic from Add to Connect
...
Thus, calling AddE with the same edge values, ignore and not throw an error.
For edge-schemas with extra fields, we maintain the same logic because we cannot
determine if the extra fields have different values that what exist in the database
2022-11-20 17:37:08 +02:00
Ariel Mashraki
5954fa8b15
dialect/sql/schema: normalize ent/schema (desired state) on replay mode ( #3100 )
2022-11-16 20:01:36 +02:00
Ariel Mashraki
891fc8fecf
dialect/sql/schema: support setting default value expressions on id fields ( #3089 )
2022-11-13 18:55:04 +02:00
Ariel Mashraki
53bdc325c0
entc/gen/schemaconfig: set alternate edge-schema names from config ( #3087 )
...
Fixed https://github.com/ent/ent/issues/3082
2022-11-12 21:42:57 +02:00
Ariel Mashraki
25021635a0
doc/fields: document default values using annotations
2022-11-12 14:38:33 +02:00
Ariel Mashraki
1e5f68646f
dialect/sql/entsql: support setting expression as column default value
...
Fixed https://github.com/ent/ent/issues/3069
2022-11-12 14:38:33 +02:00
Ariel Mashraki
3b5a535801
dialect/sql/schema: allow setting JSON default values on pg, sqlite and maria ( #3081 )
2022-11-11 07:41:21 +02:00
Ariel Mashraki
eae7d390a9
dialect/sql: add support for index operator-class using atlasgo.io ( #3073 )
2022-11-08 14:08:10 +02:00
Ronen Lubin
5d4f02620d
dialect/sql/sqljson: add ValueIsNotNull predicate ( #3058 )
...
* dialect/sql: add json ValueIsNotNull predicate
* get rid of false positive dupl linter warning
* add json valueIsNotNull case to integration tests
* fix rejects
2022-11-02 11:18:15 +02:00
Ariel Mashraki
35d0d4c3db
dialect/sql/sqlgraph: handle edge-schema in M2O/O2Oi calls entql
2022-11-01 19:46:33 +02:00
Ariel Mashraki
3ddcb76ba0
entc/gen: fix codegen typo
2022-10-26 21:08:39 +03:00
Ariel Mashraki
765ec09d31
entc/gen: add Aggregate to <T>Select and <T>Query
2022-10-23 09:50:23 +03:00