Ariel Mashraki
27d5c254d7
entc/gen: reject duplicate edge/field names ( #1029 )
2020-12-10 13:47:15 +02:00
Nathaniel Peiffer
42fa731f39
all: fix linting errors for comments ( #990 )
...
* fix: linting errors for comments
* fix: one more comment
2020-11-27 07:02:18 +02:00
Ariel Mashraki
dea48a78ea
entc/gen: merge list of entsql annotation to one ( #928 )
2020-11-08 10:57:31 +02:00
Ariel Mashraki
0231844153
entc/gen: add support for codegen hooks ( #867 )
2020-10-21 13:08:30 +03:00
Ariel Mashraki
98aeb19013
entc/internal: add snapshot restore logic ( #862 )
...
Issue #852
2020-10-19 14:51:28 +03:00
Ariel Mashraki
17ee19e23a
entc/gen: add gen.Template for ent extensions ( #859 )
2020-10-18 14:17:20 +03:00
Ariel Mashraki
7635d45c8a
entc/gen: reject codegen in case of duplicate edges ( #858 )
...
See #856
2020-10-16 14:04:52 +03:00
Ariel Mashraki
fae1956828
entql: add typed-builder for field predicates
2020-10-11 14:41:03 +03:00
Ariel Mashraki
16e804a788
entql: add experimental implementation for entql
2020-10-11 14:41:03 +03:00
Ariel Mashraki
064c25609b
entc/gen: add option to check feature-flags in templates ( #826 )
2020-10-07 17:37:39 +03:00
Ariel Mashraki
48362e79cd
entc/gen: derive the id-type from the schema ( #823 )
...
if it was not provided
2020-10-06 16:29:09 +03:00
Ariel Mashraki
5d2d2757a8
entc/gen: allow passing client-fields from multiple templates ( #819 )
2020-10-04 22:19:58 +03:00
Ariel Mashraki
d0a175f508
entc/gen: don't write assets on template failures ( #815 )
...
Calling {{ fail "error" }} from external template
should terminate the execution without local changes.
2020-10-04 12:07:55 +03:00
Ariel Mashraki
6cf2271c1b
entc/gen: initial version for feature-flags ( #803 )
2020-09-29 16:22:50 +03:00
Ariel Mashraki
235973cc2d
entc/gen: merge all templates to global
2020-09-15 16:31:29 +03:00
Ariel Mashraki
e26e99b643
entc/gen: improve the api for custom templates
2020-09-15 16:31:29 +03:00
Ariel Mashraki
5450481513
entc/gen: add support for passing functions to external templates ( #732 )
...
Fixed #671
2020-09-07 12:02:22 +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
05dfd6b78b
schema/edge: add annotation support for edges ( #651 )
2020-08-01 15:38:47 +03:00
Ariel Mashraki
1a8d98f507
entc/gen: add option to extend existing templates ( #583 )
2020-07-05 14:48:18 +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
65f96b3593
entc/gen: remove legacy i2a support for ids ( #389 )
...
* entc/gen: remove legacy i2a support for ids
* integ: add customid tests for fk strings
2020-03-16 18:19:30 +02: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
0f08a0b5f4
entc/gen: use ref-table primary-key type/size for fk attrs ( #373 )
...
Fixes #372
2020-03-04 11:14:05 +02:00
Ariel Mashraki
bb852ad093
intgeration: add pg and mysql test for customids ( #342 )
2020-02-12 20:42:03 +02:00
Ariel Mashraki
b4255998bf
entc/gen: change name format for edge fks ( #286 )
...
* entc/gen: change name format for edge fks
* dialect/sql/schema: add fixture support for mysql and postgres
* sql/dialect: merge fkcolumn queries to one for the 2 dialects
2020-02-03 15:41:55 +02:00
Ariel Mashraki
28b9ef193f
entc/gen: fix assoc-inverse struct tags assignments ( #309 )
2020-01-22 04:50:37 -05:00
Ariel Mashraki
caf721df47
entc/gen: add eager-loading support ( #263 )
...
* entc/gen: add OwnFK indicator for type edges
* entc/gen: add Edges field for generated types
* entc/gen: add With<T> method to query-builder template
* entc/gen: scan and assign foreign-keys on eager-loading
* entc/gen: load fk-relations (wip)
* entc/integration: add o2m/m2o tests for eager-loading
* entc/gen: add m2m support for eager-loading
* entc/gen: add integration tests for m2m and subgraphs
* entc/gen/integration: add tests for o2o eager-loading
* all: generate all assets
2020-01-13 17:21:26 +02:00
Ariel Mashraki
b54007ef56
Entc/enums ( #271 )
...
* ent: add default value setter to enum builder
Co-authored-by: Dario Ielardi <dario.ielardi@gmail.com >
2020-01-05 18:31:35 +02:00
Ariel Mashraki
7a85c04c32
entc/gen: add edge-fields + minor changes
2019-12-23 10:57:36 +02:00
Ariel Mashraki
e85b10be36
entc/gen: remove multi storage support
2019-12-15 14:48:55 +02:00
Ariel Mashraki
e54373f410
ent: allow non-numeric columns as PKs
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/180
Reviewed By: alexsn
Differential Revision: D18636443
fbshipit-source-id: f14b34926817f6d9652f49a640bfb377f3f3cdaf
2019-11-21 08:49:58 -08:00
Ariel Mashraki
38002e6d2e
entc/gen: use custom id type in join table ( #165 )
...
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/165
Only when it's provided by the use explicitly
Reviewed By: alexsn
Differential Revision: D18506319
fbshipit-source-id: 4cc0bb2c3bbb26f8b27b12e4aa01407fb604928d
2019-11-14 09:47:35 -08:00
Ariel Mashraki
d9da7243f9
entc/gen: initial support for user-defined ids
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/162
Reviewed By: alexsn
Differential Revision: D18485086
fbshipit-source-id: 9bb6ccff592bc0cb8b218625161ed492f67bc170
2019-11-14 08:21:31 -08:00
Ariel Mashraki
e161ecc29c
cmd/entc: remove graph printing from generator
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/163
Reviewed By: alexsn
Differential Revision: D18503829
fbshipit-source-id: 1269d4c8c30f848c5096258f2328230f5f378f69
2019-11-14 08:21:30 -08:00
Ariel Mashraki
0c46ce4e5e
entc/gen: move multistorage logic to Go code
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/94
Reviewed By: alexsn
Differential Revision: D17926186
fbshipit-source-id: b59dc418703bc4faca5230a7354edea1423b7d35
2019-10-15 06:42:44 -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
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
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
2a6060a3ab
ent/entc: no need to pass options to imports.Process
...
Summary: default options produce the same formatted output
Reviewed By: a8m
Differential Revision: D17760716
fbshipit-source-id: 556dc11e4c48c480e704f28ec779ec721137a9ba
2019-10-04 04:11:03 -07:00
Ariel Mashraki
480eb714d3
entc/gen: replace goimports with golang.org/x/tools/imports
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/53
Reviewed By: alexsn
Differential Revision: D17738814
fbshipit-source-id: 9865bc3c8eec766bd5c8e02db5c7afcaadb48c1f
2019-10-03 12:08:34 -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
c3955a08f1
schema/field: json type support ( #38 )
...
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/38
Only `IsNil` and `NotNil` predicates are supported this moment
Reviewed By: alexsn
Differential Revision: D17444976
fbshipit-source-id: 37336fa0bc7749af995933baee2e23bb7366dd78
2019-09-19 05:00:11 -07:00
Ariel Mashraki
ade72ced0d
entc/integration: test external templates with node interface ( #31 )
...
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/31
node template is just a template used for testing.
Reviewed By: dlvhdr
Differential Revision: D17327549
fbshipit-source-id: 803ac26df1b866e721edee97999d199b0935098b
2019-09-12 01:24:16 -07:00
Ariel Mashraki
6915b13d25
ent/gen: add support for external tempaltes execution
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/30
Reviewed By: dlvhdr
Differential Revision: D17318127
fbshipit-source-id: eccc2963f648296e222de9d002ab3caa8fac1389
2019-09-11 12:18:34 -07:00
Ariel Mashraki
2cc229eeb2
entc/gen: reject edge with mismatch type for back-ref
...
Reviewed By: alexsn
Differential Revision: D17260642
fbshipit-source-id: ef25dc77d9e4a7986e86d859f4f776fcf34336c9
2019-09-10 06:00:34 -07:00
Ariel Mashraki
b2cedc6c95
entc: move bindata files to internal packages
...
Summary: godoc was showing "Code generated by go-bindata. (generated) DO NOT EDIT." in the package description and exposing its methods.
Reviewed By: alexsn
Differential Revision: D17253564
fbshipit-source-id: c82082b4fa6adfba2c2663efbfacefb6423f89d9
2019-09-08 10:14:53 -07:00
Ariel Mashraki
bd07c86b60
all: add license header to all go files
...
Summary:
Used addlicense to generate this:
addlicense -c "Facebook Inc" -f license_header .
example was taken from: https://github.com/facebook/litho/blob/master/lib/soloader/BUCK
Reviewed By: alexsn
Differential Revision: D17070152
fbshipit-source-id: e7b91398d7f6181727be3400c1872ad5f28e38ed
2019-08-27 04:48:28 -07:00
Ariel Mashraki
4c3951d53b
ent/doc: m2m relation example
...
Reviewed By: alexsn
Differential Revision: D17050405
fbshipit-source-id: 85c41c92b15979b7aac8a6278a480cd593272f8a
2019-08-26 05:13:39 -07:00