유용환
8e9e6343f4
schema/edge: fix grammar in godoc ( #2313 )
2022-02-06 12:37:02 +02:00
Zhizhen He
9da36e461f
all: fix typos ( #2301 )
2022-01-29 10:30:31 +02:00
Ariel Mashraki
f8c0f02803
schema/field: add support for type-aware Default and UpdateDefault in time fields ( #2289 )
2022-01-24 14:27:57 +02:00
Clarence
eca70b8490
schema/field: array types are nillable ( #2266 )
...
* all: type fixes
* schema/field: remove array check from goType
2022-01-13 13:39:11 +02:00
Alexander Melentyev
147b1f59ae
all: small typo fixes ( #2095 )
2021-11-01 17:47:06 +02:00
Ariel Mashraki
82eeeb5a1c
entc/gen: introduce the entc.Dependency option
2021-10-26 20:33:04 +03:00
Ariel Mashraki
e687246f7a
schema/field: support default values for json and other
2021-10-21 22:57:04 +03:00
Ariel Mashraki
9e809635b2
entc/gen: ignore immutable fields on Upsert<T>.UpdateNewValues
...
Also, for some reason, the TimeMixin.UpdateTime was an immutable field,
but this was incorrent, because the codegen just skip generating
update setters to it. Removing the Immutable modifier allows users
to set this field explicitly.
2021-10-08 08:20:05 +03:00
Evan Lurvey
300f0b5307
schema/field: add the Sensitive option to field.Bytes ( #1982 )
...
* Add Sensitive() option to bytesBuilder
I have a use case where I want to store bytes but I want to use the sensitive option.
* Added new field test and ran generation
Co-authored-by: Evan Lurvey <elurvey@Evans-Mac-mini.local >
2021-09-25 23:21:55 +03:00
Ariel Mashraki
ee606f4e86
schema/field: add codegen header for template
2021-08-26 21:33:56 +03:00
Mohammed Salman
51ddb405fb
schema/field: fix annotations doc example ( #1878 )
...
* schema/field: Fix annotation doc example
* Update numeric.tpl
2021-08-26 20:31:11 +03:00
Amit Shani
60e726812b
schema/field: add NotEmpty built-in validator to bytes fields ( #1869 )
...
* added MaxLen built-in validator to `[]byte`
* typo
* move test to type_test.go
* Update doc/md/schema-fields.md
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* added min len validator to bytes
* fix tests
go generate
* CR
* add not empty validator
* CR
* doc/md: add doc on `NotEmpty` bytes validator
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2021-08-24 14:47:15 +03:00
Amit Shani
ac0bd65145
schema/field: add MinLen built-in validator to bytes fields ( #1867 )
...
* added MaxLen built-in validator to `[]byte`
* typo
* move test to type_test.go
* Update doc/md/schema-fields.md
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
* added min len validator to bytes
* fix tests
go generate
* CR
* CR
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2021-08-24 14:07:29 +03:00
Amit Shani
ad792fe79e
schema/field: add MaxLen built-in validator to bytes fields ( #1863 )
...
* added MaxLen built-in validator to `[]byte`
* typo
* move test to type_test.go
* Update doc/md/schema-fields.md
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2021-08-24 10:23:43 +03:00
Ariel Mashraki
11843ff867
go: upgrade to 1.17
2021-08-21 00:14:22 +03:00
Mohammed Salman
710d5d77e9
schema/index: update index comments ( #1814 )
...
* update index comments
* Update schema/index/index.go
Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com >
2021-08-08 12:55:04 +03:00
Ariel Mashraki
8973af9b40
schema/field: add support for setting update default funcs to numeric fields ( #1770 )
...
* schema/field:add UpdateDefault to numeric (#1718 )
* schema/field:fix comment
* schema/field: change interface to self type with DefaultFunc/UpdateDefault
* schema/field: change interface to self type with DefaultFunc/UpdateDefault
* schema/field: change interface to self type with DefaultFunc/UpdateDefault
* schema/field: add support for setting update default funcs to numeric fields
Co-authored-by: godcong <jumbycc@163.com >
2021-07-26 13:17:16 +03:00
Tarrence van As
cdfa3e35bb
entc/gen: add Exec and ExecX to Create builder ( #1753 )
2021-07-23 15:00:47 +03:00
Tarrence van As
dfc7a79f6d
schema/field: support unique bytes ( #1720 )
2021-07-20 10:24:38 +03:00
Ariel Mashraki
4eefbb6af9
schema/field: support validator for Bytes fields
...
Fixed #1714
2021-07-13 21:42:50 +03:00
Ariel Mashraki
c40ae45aee
entc/gen: add support for summing custom Go numeric types
2021-06-25 17:30:17 +03:00
Ariel Mashraki
46cf7ad36a
schema/field: store reflect type info in json fields
2021-05-31 10:04:50 +03:00
Ariel Mashraki
af73543265
schema/field: change NamedValues documentation ( #1591 )
2021-05-23 12:12:00 +03:00
Andy Day
237799dd2e
schema/field: allow non-string ValueScanner types for enum fields ( #1577 )
...
* Make non-string ValueScanner types work with enum fields
This change fixes #1575 which now makes it possible to specify a GoType
for an enum that is not a string alias. It requires that if the specified
type is not a string alias, the type must satisfy the Stringer interface.
* remove default, rename field
* wip
* remove comment
* go generate
* make optional
* generate 🤦
* handle NULL case
* turns out mysql stores strings as []uint8
2021-05-20 23:29:47 +03:00
Benjamin Bourgeais
56d8c77e5c
schema/index: add support for annotations ( #1562 )
...
* index: Add support for annotations
* entc loader: Add support for index annotations
2021-05-18 10:55:53 +03:00
Ariel Mashraki
0bfaa11e2f
schema/field: support valuescanner types for uuid fields ( #1538 )
...
Fixed #1485
2021-05-07 16:22:46 +03:00
Ariel Mashraki
9b73ca3eef
schema/field: use reflect string for rtype identifier
2021-04-26 16:57:36 +03:00
Ariel Mashraki
43e74a334f
schema/field: fix uuid import path config
2021-04-25 18:54:35 +03:00
陈杨文
7fd99a196a
schema/field: field.UUID support Nillable ( #1504 )
2021-04-23 18:33:31 +03:00
Ariel Mashraki
fd1f2df150
dialect/sql/schema: add support for pg arrays in migration
2021-04-14 14:25:28 +03:00
Ariel Mashraki
2cc1c628dc
schema/field: use actual go type in generated interfaces ( #1428 )
2021-04-07 09:53:44 +03:00
Ariel Mashraki
f3f03e1edd
schema/edge: add support for configuring foreign-key symbols
...
Fixed #1423
2021-04-04 15:27:57 +03:00
Ariel Mashraki
6e3c3b6960
schema/field: add issue number to latest change ( #1368 )
2021-03-21 21:27:05 +02:00
Matthew Clemens
c1d7e8e480
schema/field: relax the Comparable result for TypeOther ( #1304 )
2021-03-21 14:44:20 +02:00
Ariel Mashraki
c0fd7c1305
entc/gen: add edge-field api for schema and codegen ( #1213 )
2021-03-07 22:51:17 +02:00
Ariel Mashraki
dd4792f5b3
go: rename module from github.com/facebook/ent => entgo.io/ent ( #1226 )
2021-02-02 23:03:04 +02:00
Ariel Mashraki
3930d3c835
schema/field: implement field.Other ( #1218 )
...
* Implement Other Field
* Implement Other Field
* Changed dialect types
* run generate
* doc typo
* docs added
* schema/field: additional validation and tests for Other type
Co-authored-by: Ciaran Liedeman <ciaran@stackworx.io >
2021-01-31 17:43:28 +02:00
Pavel Kerbel
6d94d9e17c
schema/field: add Comment field to Descriptor ( #1173 )
...
* schema/field: add Comment value to Descriptor
* schema/field: add Comment implementation
2021-01-18 09:36:28 +02:00
Ariel Mashraki
4069af9926
schema/field: update nillable godoc
2021-01-10 14:28:12 +02:00
Ariel Mashraki
f2aa1854e4
schema/field: generate numeric builder with new godoc
2021-01-10 14:28:12 +02:00
Morgan
e4cc63c411
schema/field: add DefaultFunc for numeric types and add support for it in entc ( #1153 )
...
* entc/load: allow defaultfuncs on numeric types
* schema/field: add DefaultFunc on numeric types
* docs: document DefaultFunc better
* chore: update generated files
* pr: address issues
* docs: updates on faq, address requested changes
2021-01-10 14:05:45 +02:00
Ariel Mashraki
2ab0c682db
entc/integ: add tests for default-func
2021-01-04 11:50:55 +02:00
Ariel Mashraki
d514d12dab
schema/field: check assignment and add tests for defaultfunc
2021-01-04 11:35:55 +02:00
Travis Cline
784fc18380
schema/field: reflect the aliasing of byte in check
2021-01-03 13:43:44 -08:00
Travis Cline
53dfe95936
schema/field: relax signature of DefaultFunc for Bytes)(
2021-01-03 13:21:00 -08:00
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