Ariel Mashraki
c26d92d39e
entc/gen: support indexing edge schema with composite primary keys ( #2578 )
2022-05-30 17:20:27 +03:00
Ariel Mashraki
5800f6b578
entc/gen: avoid setting the incremental attribute fo non-integer fields ( #2571 )
2022-05-27 23:54:41 +03:00
Ariel Mashraki
e1c5277483
ent: initial support for edge schemas ( #2560 )
2022-05-25 15:46:00 +03:00
Giau. Tran Minh
196875c761
entc/gen: block Optional on ID fields ( #2443 )
...
* entc/gen: block Optional on the ID field
* chore: restore the old error message
* Update entc/gen/type.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2022-04-02 21:01:38 +03:00
Ariel Mashraki
c071898395
entc/gen: move column default quoting to template ( #2406 )
2022-03-16 13:41:19 +02:00
Ariel Mashraki
770e4d24e9
entc/gen: add Type.IsInt64 helper function for fields
2022-02-04 22:46:17 +02:00
Ariel Mashraki
1d3f1819ae
entc/gen: replace Type.Alias with Type.PackageAlias
2022-02-04 22:46:17 +02:00
Ariel Mashraki
0e49dd1d9f
entc/gen: support local package names for generated packages
...
The new Alias option adds package aliases (local names) for all type-packages that
their import identifier conflicts with user-defined packages (i.e. GoType).
2022-02-02 15:50:00 +02:00
Genevieve
16e57a92c5
entc/gen: spelling fix in error message ( #2262 )
2022-01-13 12:51:37 +02:00
Sasha Melentyev
f5fed28782
all: fix typos ( #2243 )
...
* refactor(all): Fix typo and small refactor
* refactor(all): Fix typo
2022-01-05 16:10:28 +02:00
MasseElch
76770e8a52
entc/gen: don't rely on descriptor when retrieving enum values or names to ease extension testibility ( #2211 )
...
Trying to add tests to some extensions and this is complicating things a lot because `Field.def` is unexported. Not taking the length of `def.Enums` but `Enums` directly fixes this. It technically is also more correct, because `f.Enums` could be greater than `f.def.Enums`.
2021-12-11 14:25:02 +02:00
Ariel Mashraki
6372263b99
entc/gen: add support for subtracting values from unsgined fields ( #2169 )
2021-11-25 12:37:43 +02:00
Alexander Melentyev
147b1f59ae
all: small typo fixes ( #2095 )
2021-11-01 17:47:06 +02:00
Ariel Mashraki
e687246f7a
schema/field: support default values for json and other
2021-10-21 22:57:04 +03:00
Ariel Mashraki
9e809635b2
entc/gen: ignore immutable fields on Upsert<T>.UpdateNewValues
...
Also, for some reason, the TimeMixin.UpdateTime was an immutable field,
but this was incorrent, because the codegen just skip generating
update setters to it. Removing the Immutable modifier allows users
to set this field explicitly.
2021-10-08 08:20:05 +03:00
Ariel Mashraki
87e2199309
entc/integration: add example for bytes id with custom comparable Go type
2021-09-29 18:31:01 +03:00
Ariel Mashraki
625e422a08
entc/gen: fix bug with enum separators
...
Fixed https://github.com/ent/ent/issues/1961
2021-09-24 00:03:59 +03:00
Ariel Mashraki
4c2faf2282
entc/gen: allow spaces in enum fields
2021-09-23 23:23:28 +03:00
Ariel Mashraki
430a3ee8b3
entc/gen: add example for uuid edge-field and fix #1723 ( #1731 )
2021-07-16 22:33:28 +03:00
Ariel Mashraki
d3a0b89864
entc/gen: simplify the way to get gen.Field operation
...
External templates should not deal with storage configuration
2021-06-27 11:07:38 +03:00
Ariel Mashraki
c40ae45aee
entc/gen: add support for summing custom Go numeric types
2021-06-25 17:30:17 +03:00
Ariel Mashraki
754b56856a
entc/gen: disallow immutable edge-fields
...
Until we add the immutable option for edges
2021-06-16 22:19:53 +03:00
Ariel Mashraki
66871c9806
dialect/sql/schema: add support for index prefixes in mysql
2021-06-09 22:52:31 +03:00
Mahmudul Haque
ba954ebeec
dialect/sql/schema: add field collation support ( #1548 )
...
* specific field collation support
* go generate ./...
2021-05-09 18:09:08 +03:00
Vojtěch Káně
43ef74b8a8
entc/gen: add support for default annotation to PKs as well ( #1492 )
2021-04-22 14:16:53 +03:00
Ariel Mashraki
91dda6230f
entc/gen: allow simple types to implement valuescanner
2021-04-20 14:44:31 +03:00
Ariel Mashraki
2480b5c0ef
entc/gen: wrap nillable fields with custom go-type with sql.nullscanner
2021-04-17 13:13:40 +03:00
Ariel Mashraki
30c947546f
entc: add global annotations option
2021-04-11 13:58:10 +03:00
Ariel Mashraki
8d7bb7fad6
entc/gen: check edge-field on mutation-cleared calls for edges
...
Fixed #1445
2021-04-10 14:56:34 +03:00
Ariel Mashraki
9090c103be
entc/gen: add edge method for getting mutation-remove in templates
2021-04-08 15:56:11 +03:00
Ariel Mashraki
2cc1c628dc
schema/field: use actual go type in generated interfaces ( #1428 )
2021-04-07 09:53:44 +03:00
Ariel Mashraki
745afde770
dialect/entsql: add support for column default using annotation
...
Fixed #1033
2021-04-03 21:53:56 +03:00
Ariel Mashraki
9685066b83
entc/gen: support on-delete annotation in migrate/schema
2021-03-16 15:29:21 +02:00
Ariel Mashraki
c0fd7c1305
entc/gen: add edge-field api for schema and codegen ( #1213 )
2021-03-07 22:51:17 +02:00
Matthew Gabeler-Lee
c53b45ddb0
all: use %w instead of %v to wrap errors ( #1275 )
...
* all: use %w instead of %v for nested errors with fmt.Errorf
* all: update generated code to use %w instead of %v for error wrapping
2021-03-03 20:05:33 +02:00
Ariel Mashraki
3a64e2d20d
entc/gen: use edge.owner for checking fk field ( #1293 )
...
See issue 1288
2021-03-02 17:42:52 +02:00
Ariel Mashraki
73df26b92b
entc/gen: allow setting default-func for id fields ( #1290 )
2021-03-02 11:41:23 +02:00
Ariel Mashraki
0d0a93b95f
entc/gen: add support for referencing fks to existing fields ( #1289 )
2021-03-01 22:57:32 +02:00
Ariel Mashraki
15af025dd0
entc/gen: reject schemas whose package conflicts with ent predeclared identifiers ( #1244 )
2021-02-06 16:17:52 +02:00
Nathaniel Peiffer
96ebbcd627
fix: check names against privateFields ( #1239 )
2021-02-05 11:49:42 +02:00
Ariel Mashraki
dd4792f5b3
go: rename module from github.com/facebook/ent => entgo.io/ent ( #1226 )
2021-02-02 23:03:04 +02:00
Pavel Kerbel
8ca9d55b31
load/schema: added comment to generated schema ( #1205 )
2021-01-24 22:02:33 +02:00
Ariel Mashraki
97c316b80a
entc/gen: move mutation-set naming to go api ( #1123 )
2021-01-03 22:10:19 +02:00
Nathaniel Peiffer
cfefd26543
cmd/internal/base: add name conflict check for init command ( #1110 )
...
* adds checks for name conflicts
also tidies up error handling inside init
* fix failing test, check for lower name for golang idents
* update function name and prefer builtin function
* pkg instead of lowerName
2021-01-02 22:25:39 +02:00
Noah-Jerome Lotzer
24f6975b9a
schema/field: add default-func for bytes and strings ( #1086 )
2020-12-29 20:07:04 +02:00
Santi Aguilera
75d93200e9
dialect/sql/entsql: allow non incremental primary keys ( #1074 )
...
* Allow non incremental PKs
* Format code with gofmt
* Update entc/integration/config/config_test.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* Update entc/integration/config/config_test.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* Update entc/integration/config/config_test.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* Update entc/integration/config/config_test.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* Sort imports
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2020-12-28 17:34:27 +02:00
Nathaniel Peiffer
754e89c6ae
entc/gen: add support for indexing id fields ( #991 )
...
* fix: allow indexes to be created on ID field
* test: add case for id field
* remove extraneous nil check
* change add primary method
* add integration test for mixin id
* go generate
* add default for default
* make linter happy
* invert if statement
* add default index to card integration test
* add index on default id, mixin id, and composite index
* go generate
2020-12-17 17:58:01 +02:00
Ariel Mashraki
be9955a860
entc/load: merge annotations from the same type
2020-12-13 19:16:54 +02:00
Ariel Mashraki
70f2b1355a
entc/gen: expose edge mutation setters for external templates ( #1032 )
2020-12-12 00:01:30 +02:00
Ariel Mashraki
deb368933f
entc/gen: add withFKs to reserved fields
2020-12-09 18:29:49 +02:00