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
Weilence
b0eb20f0f7
entc/gen: enable BuildFlags in *.go ( #3075 )
...
Co-authored-by: Weilence <weilence163.com>
2022-11-08 18:32:40 +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
nzlov
942eb56b2a
cmd/ent: add comments to 'describe' command ( #3067 )
2022-11-07 16:23:07 +02:00
Ariel Mashraki
a91aabe3ef
entc/gen: ensure foreign-key constraints are unique in codegen ( #3066 )
2022-11-05 07:28:50 +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
521f9b57bc
entc/gen: copy annotations to the Through meta-edge
2022-10-31 15:55:57 +02:00
Ariel Mashraki
c063978d68
entc/gen: ensure edge.StorageKey and edge.Field do not conflict
...
Fixed https://github.com/ent/ent/issues/2205 .
2022-10-30 00:08:44 +03: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
Ariel Mashraki
1bc4d48a51
dialect/sql: support scanning json fields ( #3022 )
2022-10-18 16:18:50 +03:00
Joe Wreschnig
ac725a61b7
entc: add BuildFlags to schema loader configuration ( #2801 )
...
This allows passing arbitrary build flags to the schema package loader,
which in turn can be used to pass build constraints affecting what
schema types and/or methods are visible.
As a particular use case, this should make it easier to implement
two-pass code generation to deal with circular imports in hooks (#892 ).
2022-10-16 16:53:47 +03:00
Ariel Mashraki
cf137c665a
dialect/sql/sqljson: cast marshaled args as json ( #3008 )
2022-10-11 14:15:01 +03:00
Marwan Sulaiman
713828b311
Remove unused variable and type redundancy ( #2996 )
2022-10-09 00:59:52 +03:00
Ariel Mashraki
a8dde5e0d1
dialect/sql/sqlgraph: move fields setters to method calls ( #2995 )
2022-10-08 20:08:22 +03:00
Ariel Mashraki
1029a2d3ba
entc/gen: attach tx hooks to underlying driver ( #2980 )
...
Allow attaching hooks to new instances of ent.Tx.
For example, ent.Mutation.Tx().OnCommit.
2022-10-01 09:26:02 +03:00
Ariel Mashraki
13bf27bdd6
entc/gen: support Append<F> for JSON array fields ( #2975 )
2022-09-29 16:57:54 +03:00
Ariel Mashraki
eb4ea68356
dialect/sql/sqljson: add dialect-aware Append function
2022-09-29 08:54:44 +03:00
Jannik Clausen
c41d223733
dialect/sql/schema: disable foreign keys before opening a transaction ( #2966 )
...
* dialect/sql/schema: disable foreign keys before opening a transaction
* dialect/sql/schema: disable foreign keys before opening a transaction
* fix tests
* add test for bug
* apply CR
2022-09-28 07:41:49 +02:00
Ariel Mashraki
e93e96ed1b
dialect/sql/schema: use serial underlying types for fks ( #2963 )
2022-09-27 07:54:07 +03:00
Giau. Tran Minh
679109f5c2
entc/gen: remove space around continue for 1.18 compatible ( #2962 )
...
Related: https://github.com/golang/go/issues/51670
Signed-off-by: Giau. Tran Minh <hello@giautm.dev >
Signed-off-by: Giau. Tran Minh <hello@giautm.dev >
2022-09-26 21:10:15 +03:00
Ariel Mashraki
3fc4ba6f15
dialect/entsql: add support for partial indexes ( #2944 )
2022-09-20 15:07:28 +03:00
Pedro Henrique
1f8e4ada01
entc/gen: allow package with alias on ID field ( #2926 )
...
* entc/gen: allow package with alias on ID field
* Update entc/gen/template/import.tmpl
Co-authored-by: Giau. Tran Minh <giau.tmg@gmail.com >
Co-authored-by: Giau. Tran Minh <giau.tmg@gmail.com >
2022-09-18 16:45:21 +03:00
Ariel Mashraki
ac937f8a6e
entc/gen: allow using 'client' and 'tx' as schema field names ( #2919 )
2022-09-09 10:38:25 +03:00
Ariel Mashraki
cfb038810d
dialect/sql/entsql: support including non-key columns in postgres indexes ( #2912 )
2022-09-07 22:09:48 +03:00
Ariel Mashraki
1773fc465e
dialect/sql: add support for statement prefix in update builder ( #2904 )
2022-09-06 17:34:53 +03:00
Weilence
1e12537a35
entc/gen: support custom Acronym ( #2900 )
2022-09-06 15:13:41 +03:00
Aagosh
326fe42d49
entc/gen: use FirstID instead of Count for Exist calls ( #2896 )
...
* Improve sqlexist template
* Address review comment and regenerate files
* Regenerate using go1.19
* Run go generate for examples dir
* Address review comment
* Update entc/gen/template/dialect/sql/query.tmpl
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-09-04 10:04:57 +03:00
Ariel Mashraki
2969796669
dialect/sql/sqlgraph: support batch-upadte for edge-schemas ( #2897 )
2022-09-02 15:33:41 +03:00
Weilence
f797ac2d14
entc/gen: remove repeated template fragment ( #2890 )
2022-08-30 07:50:15 +03:00
Ariel Mashraki
bedbea6665
dialct/sql/sqljson: fix HasKey implementation for SQLite ( #2887 )
2022-08-29 23:37:30 +03:00
Ariel Mashraki
79fe0ebcd6
sql/sqljson: add support for ValueIn/ValueNotIn ( #2882 )
2022-08-24 17:58:44 +03:00
Ariel Mashraki
f40cdf84f4
entc/gen: ensure immutability is consistent between edge and their fields ( #2877 )
2022-08-20 19:30:27 +03:00
Ariel Mashraki
b18ca9ca6f
schema/edge: allow setting immutable edges ( #2876 )
2022-08-20 19:10:16 +03:00
Ariel Mashraki
461ab4a3e4
entc/gen: unexpose upsert setters for immutable fields ( #2875 )
2022-08-20 18:09:12 +03:00
Ariel Mashraki
2c63d1d70e
all: gofmt -w -r 'interface{} -> any' ( #2874 )
2022-08-19 18:23:04 +03:00
Jannik Clausen
b6c185a660
dialect/sql/schema: make use of new atlas migration directories and r… ( #2873 )
...
* dialect/sql/schema: make use of new atlas migration directories and remove examples for custom formatters
* typo
2022-08-19 14:42:54 +02:00
Pedro Henrique
2b54aadcce
dialect/sql: escape EqualFold on Postgres ( #2860 )
...
* adds tests for equalFold predicates
* ensure EqualFold escapes the argument on Postgres
* adds tests on builder as well
2022-08-16 10:09:06 +03:00
Ariel Mashraki
5c2013b5fd
entc/integration: example for #2846
2022-08-14 11:10:36 +03:00
Ariel Mashraki
8fc8d65a16
doc/fields: add section for nillable-required fields
2022-08-13 20:12:28 +03:00
Ariel Mashraki
b207429f15
entc/gen: allow setting required fields as nillable
2022-08-13 20:12:28 +03:00
Ariel Mashraki
c8fc927f0d
entc/gen: add tests for bulk-upsert fix in #2840 ( #2845 )
2022-08-12 21:12:34 +03:00
Viktoriia Dlugopolskaia
7eb1ccd274
entc/gen: ignore immutable fields updating during bulk upsert ( #2840 )
2022-08-12 19:50:05 +03:00
Ariel Mashraki
0066eb986d
entc/gen: extend sql/modify to UPDATE statements
2022-08-05 14:42:04 +03:00
Ariel Mashraki
47972774c5
go: bump go/packages version ci to 1.18+1.19 ( #2832 )
...
* bumped pkg golang.org/x/tools version to address issue #2826
* .github: update go1.19 in go generate
Co-authored-by: Ankit Patial <ankitpatial@gmail.com >
2022-08-05 11:17:53 +03:00
Giau. Tran Minh
89007ec983
entc/gen: fixed privacy filter for M2M edges ( #2828 )
...
* entc: fixed privacy filter for M2M
* all: codegen
2022-08-03 23:24:25 +03:00
Ariel Mashraki
26e07c90c0
dialect/sql/sqlgraph: support edgeschema in entgql ( #2817 )
2022-08-01 18:18:12 +03:00
Ariel Mashraki
9673a4d506
entc/gen: allow naming ent/schema as Field ( #2811 )
2022-07-29 13:17:20 +03:00