Commit Graph

65 Commits

Author SHA1 Message Date
Travis Cline
952a34c9c2 schema/field: relax signature of DefaultFunc for String() 2021-01-03 13:15:00 -08:00
Ariel Mashraki
56b3db8448 schema/field: remove deprecated valuemap option (#1118) 2021-01-02 20:15:10 +02:00
Ariel Mashraki
6716581ab4 entc/gen: handle default funcs in runtime tempalte (#1102) 2020-12-30 13:05:03 +02:00
Noah-Jerome Lotzer
24f6975b9a schema/field: add default-func for bytes and strings (#1086) 2020-12-29 20:07:04 +02:00
Travis Cline
3f163923b0 schema/field: change Err to be exported on Descriptor (#1098) 2020-12-29 10:13:06 +02:00
Ariel Mashraki
d89ace2750 schema/field: add const name for type other (#1038) 2020-12-13 19:37:12 +02:00
Ariel Mashraki
be9955a860 entc/load: merge annotations from the same type 2020-12-13 19:16:54 +02:00
Ariel Mashraki
2716f04b1b schema/field: implement merge for field annotations 2020-12-13 19:16:54 +02:00
Ariel Mashraki
fe47093c55 schema/field: improve error message for GoType (#969) 2020-11-20 23:48:54 +02:00
Ariel Mashraki
3d2feec5e2 dialect/sql/schema: initial support for postgres net-types (#964) 2020-11-20 15:30:54 +02:00
Ciaran Liedeman
e26d81d9a5 dialect/sql/schema: allow migrations from integer to string without size limit (#952)
* Allow migrations from integer to string without size limit

* Update entc/integration/migrate/entv1/schema/user.go

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

* run generate

* Update entc/integration/migrate/entv2/schema/user.go

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

Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
2020-11-16 11:44:04 +02:00
Ariel Mashraki
d3849f9eb7 schema: remove functional options from field/edge annotations 2020-10-12 13:06:25 +03:00
Ariel Mashraki
ab9aa1fa45 schema/field: add annotations for overriding field struct-tags 2020-10-12 13:06:25 +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
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
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
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
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
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
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
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
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