mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
ent/doc: add enum field type to docs
Reviewed By: alexsn Differential Revision: D17737409 fbshipit-source-id: b12c2a3b5da7b4ca06818785d55dfeda0a2e85f1
This commit is contained in:
committed by
Facebook Github Bot
parent
50637b439e
commit
8b9e5cd7d0
@@ -52,6 +52,7 @@ The following types are currently supported by the framework:
|
||||
- `time.Time`
|
||||
- `[]byte` (only supported by SQL dialects).
|
||||
- `JSON` (only supported by SQL dialects) - **experimental**.
|
||||
- `Enum` (only supported by SQL dialects).
|
||||
|
||||
<br/>
|
||||
```go
|
||||
@@ -86,6 +87,9 @@ func (User) Fields() []ent.Field {
|
||||
Optional(),
|
||||
field.JSON("strings", []string{}).
|
||||
Optional(),
|
||||
field.Enum("state").
|
||||
Values("on", "off").
|
||||
Optional(),
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user