Commit Graph

66 Commits

Author SHA1 Message Date
Ariel Mashraki
d5ae1b018e schema/mixin: add privacy policy to mixin (#821) 2020-10-06 10:59:36 +03:00
Ariel Mashraki
1b5f51b827 schema: shared annotation interface for schema objects (#813) 2020-10-03 16:51:00 +03:00
Ariel Mashraki
e514457859 schema/field: fix broken logic in ValueMap (#716) 2020-08-30 17:54:01 +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
5c170bce8f schema/mixin: add AnnotateEdges helper (#659) 2020-08-06 13:03:34 +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
04859c6fb4 schema/field: add GoType support for enum fields (#638) 2020-07-24 19:59:05 +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
7425b90e01 schema/mixin: rename Annotate to AnnotateFields (#628) 2020-07-21 10:15:16 +03:00
Alex Snast
31105f408d schema/mixin: adding mixin.Annotate helper which adds anootations to mixin fields (#625)
Signed-off-by: Alex Snast <alexsn@fb.com>
2020-07-20 11:48:42 +03:00
Ariel Mashraki
54f0a6769b schema/field: add annotation option to schema field (#622) 2020-07-19 18:01:04 +03:00
Mohammed Abubakar
902b29d9bf schema/field: add the Unique option to the UUID field builder (#579)
* add the Unique option to the UUID field builder

* Update schema/field/field_test.go

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

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2020-07-03 16:31:30 +03:00
Ariel Mashraki
5e58b094d8 schema/field: add Comparable method to TypeInfo (#576) 2020-07-02 16:34:34 +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
9e0d5755ef schema/field: add GoType option for float fields (#534) 2020-06-09 08:20:54 +03:00
Ariel Mashraki
59b880a6ba schema/field: add GoType option for int fields (#528) 2020-06-07 15:58:56 +03:00
Ariel Mashraki
a43ceb1595 schema/field: add GoType option for bytes fields (#523) 2020-06-04 13:48:13 +03:00
Ariel Mashraki
fff0b1a9ed schema/field: add GoType option for time fields (#520) 2020-06-03 14:36:49 +03:00
Ariel Mashraki
916099611b gotype/bool: support valuescanner in codegen (#517) 2020-06-01 21:45:20 +03:00
Ariel Mashraki
ef8f64bcff schema/field: add GoType option for boolean (#516) 2020-06-01 17:33:03 +03:00
Ariel Mashraki
bf566aa3ac entc/gen: support valuescanner in go-types (#510) 2020-05-28 18:23:14 +03:00
Ariel Mashraki
ce89688d00 schema/field: reject pointers for basic types (#505) 2020-05-26 23:16:54 +03:00
Ariel Mashraki
100d300094 schema/field: add GoType option for string fields (#500) 2020-05-25 20:05:17 +03:00
Ariel Mashraki
31690c7e60 schema/field: add Err method to field descriptor (#498) 2020-05-21 22:06:49 +03:00
Ariel Mashraki
cfee55e514 schema/field: add an option to configure the database type (#484) 2020-05-11 15:07:33 +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
danforth
89fade53f6 schema/field: fix error description in MaxLen (#299)
Co-authored-by: heavycharged <41610989+heavycharged@users.noreply.github.com>
2020-01-20 08:29:32 -05: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
c6800a3869 entc/gen: move node creation to sqlgraph 2019-12-17 22:45:04 +02:00
Jeremy
58b5389275 schema/edge: fix comment error on builder 2019-12-15 19:10:26 +02:00
Jeremy
d9c1076027 schema/field: enhance test cases 2019-12-14 13:08:53 +02: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
Alex Snast
b34c955739 ent/entc: adding NonNegative predicate to signed int types
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/179

Reviewed By: a8m

Differential Revision: D18617566

fbshipit-source-id: ab5ced97836d05ee5936b39f571063cf618b3481
2019-11-20 10:11:58 -08:00
Ariel Mashraki
33d08673cf schema/field: initial work for UUID fields
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/175

Reviewed By: idoshveki

Differential Revision: D18614288

fbshipit-source-id: d36e6dc6e7745e982cf91bb4c4548dcd3d9d33ac
2019-11-20 07:14:40 -08:00
Ariel Mashraki
49c8efce3c schema/field: fix type jsons -> json
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/173

Reviewed By: idoshveki

Differential Revision: D18614200

fbshipit-source-id: d4da2da3e150a83b12f7404672bbbad1f46aad22
2019-11-20 07:14:40 -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
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
a5b1805da3 ent/entc: rename time mixin fields (#109)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/109

- created_at -> create_time
- updated_at -> update_time

Reviewed By: a8m

Differential Revision: D18035896

fbshipit-source-id: ec9aef703c444554eb0f65a668703a1a6607b93e
2019-10-22 03:45:52 -07:00
Ariel Mashraki
e9d9deffe4 schema/schemautil: add license header for schemautil files
Reviewed By: alexsn

Differential Revision: D17953335

fbshipit-source-id: 6178e4121a4bbd241374f1d6ad5a447188d48fb1
2019-10-17 01:55:41 -07:00
Alex Snast
38b1fc9e66 ent/schema: adding schemautil package (#100)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/100

package includes time mixins adding created_at / updated_at fields

Reviewed By: a8m

Differential Revision: D17950845

fbshipit-source-id: 84c0e7b82ed09857375a42add4254a4a85a52335
2019-10-16 03:47:57 -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
a425896a4e ent/schema/field: add missing license header
Reviewed By: JoelMarcey

Differential Revision: D17724252

fbshipit-source-id: d8bc5a77776257f44fc0fd89786537738d9161fe
2019-10-02 14:42:12 -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
Alex Snast
517d22843c ent/schema: adding .NotEmpty() helper to string field
Summary: just a wrapper around .MinLen(1) but makes it cleaner when reading the schema

Reviewed By: a8m

Differential Revision: D17551384

fbshipit-source-id: 1e2c7639eff7032f433271582830c7e11a2fb0d5
2019-09-25 00:00:42 -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
624ecd2cc7 schema/field: add storage-key option
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/35

Reviewed By: alexsn

Differential Revision: D17394930

fbshipit-source-id: bc9d8cc6569ad457b93d47d26d143f2442f98df9
2019-09-16 04:39:17 -07:00