Commit Graph

29 Commits

Author SHA1 Message Date
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
17ee19e23a entc/gen: add gen.Template for ent extensions (#859) 2020-10-18 14:17:20 +03:00
Ariel Mashraki
fae1956828 entql: add typed-builder for field predicates 2020-10-11 14:41:03 +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
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
Ciaran Liedeman
54774960b2 entc/gen: add template for creating custom predicates (#758)
* Custom Predicates

* Update entc/integration/template/ent/template/where.tmpl

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>


Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2020-09-14 15:41:48 +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
1a8d98f507 entc/gen: add option to extend existing templates (#583) 2020-07-05 14:48:18 +03:00
Ariel Mashraki
d3b89fb2be entc/gen: add enttest package for generated code. (#442)
* entc/gen: add enttest package for generated code.

It's still WIP and another 2 things need to be added:
- Add an option to skip schema migration and pass client options
- Update docs and replace existing testing code to use enttest

* entc/gen: finish enttest package tempalte

Signed-off-by: Alex Snast <alexsn@fb.com>

Co-authored-by: Alex Snast <alexsn@fb.com>
2020-04-20 16:37:26 +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
dc222c0b15 entc/gen: remove example_test template from codegen (#351)
Fixes #297
2020-02-18 12:26:46 +02:00
Ariel Mashraki
e85b10be36 entc/gen: remove multi storage support 2019-12-15 14:48:55 +02: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
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
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
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
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
c203f043cf ent: add blob tyoe
Reviewed By: idoshveki

Differential Revision: D16600425

fbshipit-source-id: 04c6fe39f9b3b628a1e79eb3063188f582d9e504
2019-08-01 07:45:05 -07:00
Ariel Mashraki
8cb2428ea3 ent: fix lint errors
Reviewed By: idoshveki

Differential Revision: D16560151

fbshipit-source-id: 703f6e28403b14fc667fa7c592f0f3827a9335a6
2019-07-30 05:31:33 -07:00
Ariel Mashraki
56656dfcb6 ent/entc: configure storage driver in codegen
Summary: Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1229

Reviewed By: alexsn

Differential Revision: D16539934

fbshipit-source-id: b3a8bf1f1be6f65ad3f649cd921ea20fc24182bf
2019-07-30 02:49:22 -07:00
Ariel Mashraki
2cfda7564f type safe predicates
Reviewed By: alexsn

Differential Revision: D16452717

fbshipit-source-id: da0a07275434d95d73a5a26830a2e5535c3abf47
2019-07-24 08:35:51 -07:00
Alex Snast
ad051e6d72 adding ent client context load/store support
Summary: Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1148

Reviewed By: a8m

Differential Revision: D16202464

fbshipit-source-id: 15174e19e5e514774928e4e682d1c2743e863a26
2019-07-14 08:33:14 -07:00
facebook-github-bot
267e3c15bd Initial commit
fbshipit-source-id: c79a38536e3c128dce1b2948615b72ec9779ed22
2019-06-16 04:37:51 -07:00