Commit Graph

18 Commits

Author SHA1 Message Date
Alex Snast
6e6651c878 Query policy (#411)
* entc/gen: drop xerrors package usage

* all: bump dependencies version

* entc/gen: adding query privacy policy support
2020-03-29 18:11:13 +03:00
Alex Snast
63c6d9786d entc/gen: adding ent.Query type
Signed-off-by: Alex Snast <alexsn@fb.com>
2020-03-19 14:30:00 +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
Alex Snast
091f9aba12 entc/gen: check for nil error before invoking .As
Signed-off-by: Alex Snast <alexsn@fb.com>
2020-01-30 13:42:13 +01:00
Alex Snast
0428788539 entc/gen: add support for wrapped errors
Signed-off-by: Alex Snast <alexsn@fb.com>
2020-01-30 10:53:58 +01:00
Ariel Mashraki
27935a8c6c entc/gen: add <E>Loaded for <T>Edges (#319)
This helps to determine if the edge was loaded (or requested) in
eager-loading even if it's empty.
2020-01-29 11:39:19 +02:00
Ariel Mashraki
7a480e3943 entc/gen: use more go-ish names for generated error types (#321)
* entc/gen: use more go-ish names for generated error types

* entc/gen: add NotLodedError type for eager-load api
2020-01-28 11:04:27 +02:00
Ariel Mashraki
798d58f02b all: use more go-ish error for constraint failures 2019-12-17 23:17:55 +02:00
Ariel Mashraki
e85b10be36 entc/gen: remove multi storage support 2019-12-15 14:48:55 +02:00
Ariel Mashraki
c259aee24b entc/gen: generate sql builders with dialect option
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/130

Reviewed By: alexsn

Differential Revision: D18164397

fbshipit-source-id: 2858d69d3ff85c06b51382c01c3d4369ee2c3bdb
2019-10-27 21:53:50 -07: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
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
4323141fe2 ent: add license and copyright to template files
Reviewed By: alexsn

Differential Revision: D17149292

fbshipit-source-id: 837de5fad988de1e54438b47584701f2fc35326d
2019-09-01 03:03:15 -07:00
Ariel Mashraki
cef32f1fb4 entc: add option to override codegen header
Summary:
Set the standard header ("Code generated by entc, DO NOT EDIT.") as default, and override it using option in graph.

No changes to graph except the `generate.go` file.

Reviewed By: idoshveki

Differential Revision: D16642348

fbshipit-source-id: d9fd1d2046e2fd96acbb100ef061fda75d99ce52
2019-08-04 05:12: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
1cf3c3a117 adding ent.MaskNotFound generated helper
Reviewed By: a8m

Differential Revision: D16121210

fbshipit-source-id: c956551c975192cf997496490dd3e243022fbfb3
2019-07-04 09:37:27 -07:00
facebook-github-bot
267e3c15bd Initial commit
fbshipit-source-id: c79a38536e3c128dce1b2948615b72ec9779ed22
2019-06-16 04:37:51 -07:00