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
Ariel Mashraki
7dfe3c174c
sql/schema: more precise blob definition
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/29
Reviewed By: alexsn
Differential Revision: D17284406
fbshipit-source-id: 84c2ffb50b8f016ad361f1420c5352c7969cbc77
2019-09-10 12:40:37 -07:00
Alex Snast
b71ee6820b
ent/schema: remove string field charset / collation settings
...
Summary: don't expose starage specific features in ent schema
Reviewed By: a8m
Differential Revision: D17111724
fbshipit-source-id: fca9e624b272c0db3fed14c511fa6cb07816a100
2019-08-29 07:38:39 -07:00
Alex Snast
4c1f28d58f
ent/schema: allow setting collation for string fields
...
Reviewed By: a8m
Differential Revision: D17090481
fbshipit-source-id: a08768c9bac4318a91bc6a067c85d6eb022c3024
2019-08-28 04:52:32 -07:00
Alex Snast
373769dfaf
ent/gen: adding EqualFold predicate for string fields
...
Summary: Similar to `ContainsFold` predicate requires `--storage=sql` argument to be passed to entc.
Reviewed By: a8m
Differential Revision: D17074805
fbshipit-source-id: ced299154417fe2c9007cd6a7a504f53c8b2ef98
2019-08-27 10:48:53 -07:00
Ariel Mashraki
772b8a33f8
ent/field: add update_default option time field
...
Reviewed By: alexsn
Differential Revision: D17070907
fbshipit-source-id: 63c9ce75c58e524044c38f9461cb04e8e45c8017
2019-08-27 06:54:49 -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
3e7270e835
ent/schema: change ent interafces for descriptor only
...
Summary: wip
Reviewed By: alexsn
Differential Revision: D17052576
fbshipit-source-id: 165faca2ff02c22bb76f164d81d406ce46ab04c4
2019-08-27 03:58:25 -07:00
Ariel Mashraki
52292557f6
entc/indexes: inverse only restriction applies only on O2O relation
...
Reviewed By: alexsn
Differential Revision: D17004823
fbshipit-source-id: 08b62960b447a157419dbeefd80ca1fcd29efd76
2019-08-25 06:41:14 -07:00
Alex Snast
e6a1333b9d
ent/schema: allow multi from edges on ent index
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/24
Reviewed By: a8m
Differential Revision: D16961315
fbshipit-source-id: cd7cd0fe2555dc1acc2ad7301d92b5b4cd042a39
2019-08-22 07:00:29 -07:00
Ariel Mashraki
f519a5465e
schema/field: add builder per numeric type
...
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/21
Reviewed By: alexsn
Differential Revision: D16936906
fbshipit-source-id: 06f5721ed0088107cf42382731f8b7282f22eef7
2019-08-21 08:00:01 -07:00
Alex Snast
85b29631a8
entc/schema: adding support for immutable fields ( #1340 )
...
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1340
Immutable fields are ent fields which cannot be updated
Reviewed By: a8m
Differential Revision: D16899625
fbshipit-source-id: ca482c66570e84ca9a1e0a03f729847561f2816b
2019-08-20 02:17:13 -07:00
Ariel Mashraki
e0e754717e
ent: change ent package name ( #1338 )
...
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1338
Pull Request resolved: https://github.com/facebookincubator/ent/pull/14
Reviewed By: alexsn
Differential Revision: D16890825
fbshipit-source-id: 656baaa73f5debab08c849b6b9639caeec2a8ef1
2019-08-19 09:32:14 -07:00
Alex Snast
a209a8395e
schema/field: Allow .Unique() definition on int / float fields
...
Reviewed By: a8m
Differential Revision: D16891088
fbshipit-source-id: b3d8375685b6d1957f678c2f9eb40e172891b255
2019-08-19 06:35:26 -07:00
Ariel Mashraki
079ba191e3
ent/field: add default value for time
...
Reviewed By: alexsn
Differential Revision: D16890453
fbshipit-source-id: 362ae9e9666c523bdcce16503441565b6279ff08
2019-08-19 04:21:25 -07:00
Ariel Mashraki
c16d3c8e25
ent/schema: explicitly defines non-null fields in schema
...
Reviewed By: alexsn
Differential Revision: D16791620
fbshipit-source-id: bad3ac7b2349d2f483c804eb3623c6dfa8b06313
2019-08-15 03:37:17 -07:00
Ariel Mashraki
108affa8dd
ent/schema: move schema packages into a separate package
...
Reviewed By: alexsn
Differential Revision: D16763332
fbshipit-source-id: e3e4279c62992de192464c3d3b1036c45687507c
2019-08-12 07:53:03 -07:00