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
Ariel Mashraki
c5b790043c
entc: change the way we inject additional fields ( #1560 )
...
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1560
Pull Request resolved: https://github.com/facebookincubator/ent/pull/96
Reviewed By: alexsn
Differential Revision: D17931147
fbshipit-source-id: 24e1d72be482cb787c557f46feeb2ed4a31dfe60
2019-10-15 12:00:46 -07:00
Alex Snast
5d988870bc
ent/entc: use select/scan on id query ( #1552 )
...
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1552
Pull Request resolved: https://github.com/facebookincubator/ent/pull/93
avoids complete ent load on id query
Reviewed By: a8m
Differential Revision: D17906002
fbshipit-source-id: 7749a0d7c707858eab368978a1d220b581ea6dbb
2019-10-14 23:16:14 -07:00
Ariel Mashraki
c2418a1907
entc/gen: suspended goimports after files were written ( #89 )
...
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/89
We can't run "imports" on files when the state is not completed. Because, "goimports" will drop undefined package. Therefore, it's suspended to end of the writing.
Fixed #88
Reviewed By: alexsn
Differential Revision: D17899321
fbshipit-source-id: 198dae11b121869764ebc9eee92110caf4256bed
2019-10-13 07:03:11 -07:00
Ariel Mashraki
6f5f42ab3c
dialect/sql: dialect based builders ( #1550 )
...
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1550
Pull Request resolved: https://github.com/facebookincubator/ent/pull/84
This is still WIP and you should ignore this.
Reviewed By: alexsn
Differential Revision: D17854477
fbshipit-source-id: 2d19713c118adb31164b7a2781327e64c87db8d4
2019-10-13 07:03:11 -07:00
Alex Snast
ce2bc07c1a
ent/circleci: adding linter tests
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/80
Reviewed By: a8m
Differential Revision: D17837182
fbshipit-source-id: 9fb539fd6cebc064d2d2804bd52e0fbf413cfc93
2019-10-10 04:45:07 -07:00
Ido Shveki
3d0d8724b0
ent/schema: adding sensitive fields support ( #75 )
...
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/75
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1539
Supporting "Sensitive" mode for string fields.
Reviewed By: a8m
Differential Revision: D17786543
fbshipit-source-id: a4d022c1436472cb525cdd50663dd0ce23d13699
2019-10-07 07:46:28 -07:00
Ariel Mashraki
7597f07912
entc: add option to use entc as package
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/72
Reviewed By: alexsn
Differential Revision: D17783580
fbshipit-source-id: 597f124a28415fef66b0b16811ad2acac8df631d
2019-10-07 07:06:32 -07:00
Alex Snast
e668326c5e
ent/entc: set go-bindata version in go.mod ( #74 )
...
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/74
don't rely on local go-bindata binary
Reviewed By: a8m
Differential Revision: D17786303
fbshipit-source-id: 1d1258478fd8f3abcdb3a7b1b06d0601b4468c94
2019-10-07 02:20:47 -07:00
Alex Snast
ac50ea81d4
ent: address several lint errors throughout the project ( #1534 )
...
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1534
Pull Request resolved: https://github.com/facebookincubator/ent/pull/73
lint errors detected by running `golangci-lint` tool.
Reviewed By: a8m
Differential Revision: D17784980
fbshipit-source-id: f7e8bd99fdf1e018d5672cea1e8d44b67f2a4201
2019-10-06 23:59:12 -07:00
Ariel Mashraki
b64330e475
ent/gen: remove redundant nillable check
...
Summary: nillable must be optional
Reviewed By: alexsn
Differential Revision: D17763004
fbshipit-source-id: 9c134e1648d1a387d90a5f2353de855a1aa3464f
2019-10-05 11:03:05 -07:00
Ariel Mashraki
fc3e7f0a70
all: minor style changes
...
Reviewed By: noamsch
Differential Revision: D17763014
fbshipit-source-id: ba574059dcd93e7b02e22b6eac7c6a637bf5ba30
2019-10-05 11:03:05 -07:00
Ariel Mashraki
1750d33bd8
all: add support for running examples in playground
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/49
Reviewed By: alexsn
Differential Revision: D17735758
fbshipit-source-id: d4b80631e56870690cc54912528c9950f4e48ccc
2019-10-03 03:05:40 -07:00
Ariel Mashraki
1ebfa489c5
ent: add support for enum types
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/45
Reviewed By: alexsn
Differential Revision: D17715085
fbshipit-source-id: 7472e1bd9cf7a8a5bd98f96e6e884c0e27f36803
2019-10-02 12:55:28 -07:00
Ariel Mashraki
cb1f78f233
entc/gen: add open func for creating client
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/44
Reviewed By: alexsn
Differential Revision: D17657719
fbshipit-source-id: 9bbe18dc0e9c553f8a2df81018d7db06f38f5e0e
2019-10-02 01:41:40 -07:00
Ariel Mashraki
4dbebe68ff
entc: add codegen support for mixin
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/43
Reviewed By: alexsn
Differential Revision: D17600868
fbshipit-source-id: 39a242a541fa2a2dd2db1c9919fecf192ff098bf
2019-09-26 07:41:11 -07:00
Alex Snast
6cf5b918c3
ent/entc: keep struct tags sorted
...
Summary: keeping tags sorted will prevent codegen changes due to random map key ordering
Reviewed By: a8m
Differential Revision: D17571598
fbshipit-source-id: 12afc4aa0d030aa178e6568eb7c768ccc159f726
2019-09-25 06:48:01 -07:00
Ariel Mashraki
3f7553af20
entc/gen: add tag ignoring for private fields
...
Summary: Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1487
Reviewed By: alexsn
Differential Revision: D17527793
fbshipit-source-id: b264706b8af74ff94d384dddd1b5a14661478676
2019-09-23 09:48:24 -07:00
Ariel Mashraki
76f5b6ec5f
ent/schema: add config for customize schema options
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/40
Reviewed By: alexsn
Differential Revision: D17480104
fbshipit-source-id: 5223430e3b2223b8471a85bd1d85b445f23acfce
2019-09-22 01:38:07 -07:00