Commit Graph

104 Commits

Author SHA1 Message Date
Ariel Mashraki
2c63d1d70e all: gofmt -w -r 'interface{} -> any' (#2874) 2022-08-19 18:23:04 +03:00
Will Bicks
cd1afb235c entc: improve generated comments for edges and fields (#2632)
* replace default field comment with user comment if defined
* use comments defined on edges in generated entities
* add docs for comment method on edges and fields
* update integration to reflect above changes
2022-06-13 15:52:47 +03:00
Ariel Mashraki
e1c5277483 ent: initial support for edge schemas (#2560) 2022-05-25 15:46:00 +03:00
Zhizhen He
9da36e461f all: fix typos (#2301) 2022-01-29 10:30:31 +02:00
Ariel Mashraki
d432d880c7 entc/load: add go module info to schema spec (#2175) 2021-12-01 11:30:38 +02:00
Ariel Mashraki
e687246f7a schema/field: support default values for json and other 2021-10-21 22:57:04 +03:00
Ariel Mashraki
41e2d0c9b5 entc/load: replace bindata with package embed 2021-08-21 17:13:44 +03:00
Ariel Mashraki
11843ff867 go: upgrade to 1.17 2021-08-21 00:14:22 +03:00
Ariel Mashraki
eb87d64980 all: remove pkg/errors 2021-08-05 17:37:34 +03:00
Zeev Manilovich
e46b18f078 entc/load: removing unneeded var from template (#1737) 2021-07-19 12:03:03 +03:00
Benjamin Bourgeais
56d8c77e5c schema/index: add support for annotations (#1562)
* index: Add support for annotations

* entc loader: Add support for index annotations
2021-05-18 10:55:53 +03:00
Ariel Mashraki
6b939670f5 entc/load: improve godoc and add pkgpath to errors 2021-04-28 11:11:44 +03:00
Ariel Mashraki
30c947546f entc: add global annotations option 2021-04-11 13:58:10 +03: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
31bee10942 entc/gen: support zero value as default argument in schema migration (#1287) 2021-03-01 14:42:09 +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
Morgan
e4cc63c411 schema/field: add DefaultFunc for numeric types and add support for it in entc (#1153)
* entc/load: allow defaultfuncs on numeric types

* schema/field: add DefaultFunc on numeric types

* docs: document DefaultFunc better

* chore: update generated files

* pr: address issues

* docs: updates on faq, address requested changes
2021-01-10 14:05:45 +02:00
Ariel Mashraki
d4e04cd08f entc/load: add reflect kind for default value (#1101) 2020-12-29 10:21:55 +02:00
Travis Cline
3f163923b0 schema/field: change Err to be exported on Descriptor (#1098) 2020-12-29 10:13:06 +02:00
Alex Snast
29cd5f2750 entc: drop deprecated packages.LoadSyntax usage (#1039) 2020-12-14 08:56:33 +02:00
Ariel Mashraki
be9955a860 entc/load: merge annotations from the same type 2020-12-13 19:16:54 +02:00
Ariel Mashraki
6b2673f82d entc/load: support list of annotation from the same type (#927) 2020-11-08 10:33:46 +02:00
Aleksandr Razumov
8139aca845 entc/gen: fix typo in MaskNotFound func comment (#904)
* entc: use go-bindata --mode flag

This prevents unexpected changes in generated files if
system file mode is different from generated.

* entc/gen: fix typo in "MaskNotFound" func comment
2020-10-30 20:52:57 +02:00
Ariel Mashraki
98aeb19013 entc/internal: add snapshot restore logic (#862)
Issue #852
2020-10-19 14:51:28 +03:00
Ariel Mashraki
c8a6527612 schema/mixin: add support for mixed-in annotations 2020-10-12 13:06:25 +03:00
Ariel Mashraki
85c4999472 ent: add annotations to type schema 2020-10-12 13:06:25 +03:00
Ariel Mashraki
d5ae1b018e schema/mixin: add privacy policy to mixin (#821) 2020-10-06 10:59:36 +03:00
Ariel Mashraki
027a0f6a35 schema/field: add the NamedValues option to the enum builder (#715) 2020-08-30 17:40:09 +03:00
Ariel Mashraki
5e56543133 schema/edge: fix edge annotations with to/from builders (#679) 2020-08-20 12:15:43 +03:00
Ariel Mashraki
fd0a7f9f02 all: facebookincubator/ent => facebook/ent (#660)
ent repository is going to be migrated to facebook organization
2020-08-18 11:05:08 +03:00
Ariel Mashraki
b5a9c66290 entc/gen: import siblings packages by default (#655)
Also, add missing pkg-path for non-value types.
2020-08-02 15:06:05 +03:00
Ariel Mashraki
05dfd6b78b schema/edge: add annotation support for edges (#651) 2020-08-01 15:38:47 +03:00
Ariel Mashraki
daaa9f2db1 schema/field: add option to set the Go identifier for enums (#635) 2020-07-22 20:22:24 +03:00
Ariel Mashraki
54f0a6769b schema/field: add annotation option to schema field (#622) 2020-07-19 18:01:04 +03:00
Ariel Mashraki
47f1a203aa schema/edge: an storage-key option for edges (#545)
* schema/edge: an storage-key option for edges

* schema/edge: use Column(s) with functional options
2020-06-15 23:06:00 +03:00
Ariel Mashraki
31690c7e60 schema/field: add Err method to field descriptor (#498) 2020-05-21 22:06:49 +03:00
Ariel Mashraki
9b14556314 entc/load: report mixin name on failures (#476) 2020-05-08 14:17:55 +03:00
Ariel Mashraki
6fbb5b6b4a entc/load: add schema-type field for schema (#459) 2020-05-04 19:35:40 +03:00
Ariel Mashraki
1c49159d18 entc/gen: add indexes, edges and hooks to mixin (#431) 2020-04-20 13:40:56 +03:00
Ariel Mashraki
7988d3084d entc/hooks: initial work for mutations and hooks (#377)
* entc/hooks: initial work for mutations and hooks

* ent/schema: adding policy to schema

* ent: change op string to uint

* entc: move entschema to runtime and enable smooth transition

* entc/privacy: adding privacy template

* all: goimports

* intg/hooks: mutation client/tx and basic schema tests

* ent/privacy: adding more verbose decisions

* entc/gen: edge-ids getter and additional tests

* all: regen assets

* entc/gen: fix client hookd propagation

* intg: add deletion example

* intg/privacy: remove old entschema package

* typed privacy

* ent/privacy: hooks shouldn't be called on privacy deny

* entc/gen: fix schema hooks invocation order

* remove read policy from public api

* update circleci go orb

Co-authored-by: Ariel Mashraki <ariel@mashraki.co.il>
2020-03-16 00:19:27 +02:00
Ariel Mashraki
bb852ad093 intgeration: add pg and mysql test for customids (#342) 2020-02-12 20:42:03 +02:00
Ariel Mashraki
d2fe7199e5 entc/load: return packages.Load error when 'go list' fails (#187)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/187

Also, remove the dependency of pkg/errors from load package.

Reviewed By: alexsn

Differential Revision: D18672979

fbshipit-source-id: 88a881a99e93896f8d3a0aefcf61fbd995b7fa08
2019-11-24 07:11:22 -08:00
Ariel Mashraki
1e49561634 ent: support external uuid types (#181)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/181

The lack of generic typing requires to check the function type in the "loading" phase of the schema.

Reviewed By: alexsn

Differential Revision: D18636969

fbshipit-source-id: d8229779bf3c2490e51f5d0d4c550c70e2cd2550
2019-11-21 08:49:59 -08:00
Ariel Mashraki
3c6661fce8 schema/index: add storage-key option for indexes
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/172

Reviewed By: alexsn

Differential Revision: D18571700

fbshipit-source-id: 2b8dbcc7c36be01ba383c48f982f59361a68c621
2019-11-18 07:54:56 -08:00
Ariel Mashraki
829de26c4f entc/load: add the default value for schema fields when possible (#170)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/170

Used to verify enum default values in the genrator

Reviewed By: alexsn

Differential Revision: D18561625

fbshipit-source-id: fde153a042d2e7b6da7f7d2c5b045c93266e276f
2019-11-17 09:06:58 -08:00
Ariel Mashraki
6ce4cb6803 all: fix minor lint errors
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/159

Reviewed By: dlvhdr

Differential Revision: D18476131

fbshipit-source-id: 9e792f5a35f25233aad73f75f12d13d215a21ad2
2019-11-13 06:01:41 -08:00
Alex Snast
75f59d76ad ent/entc: drop modtime from generated bindata
Summary: Keep bindata code consistent accross `go generate` executions.

Reviewed By: a8m

Differential Revision: D17977276

fbshipit-source-id: 7bc1eecf23f59c0732399ec69e484a594a611d31
2019-10-17 01:55:41 -07:00
Ariel Mashraki
c6b395904c entc/load: avoid panic due to index out of range (#99)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/99

go/packages now returns partial packages instead of error and this can cause an index of out range.

Reviewed By: alexsn

Differential Revision: D17939156

fbshipit-source-id: d02867a0cca5f1e90ac4952ac4136d8c8086a944
2019-10-15 22:17:02 -07:00