mirror of
https://github.com/ent/ent.git
synced 2026-05-02 23:50:54 +03:00
doc/schema-fields: fix grammar errors (#1686)
This commit is contained in:
@@ -419,12 +419,12 @@ func (User) Fields() []ent.Field {
|
||||
|
||||
## Nillable
|
||||
Sometimes you want to be able to distinguish between the zero value of fields
|
||||
and `nil`; for example if the database column contains `0` or `NULL`.
|
||||
and `nil`; for example, if the database column contains `0` or `NULL`.
|
||||
The `Nillable` option exists exactly for this.
|
||||
|
||||
If you have an `Optional` field of type `T`, setting it to `Nillable` will generate
|
||||
a struct field with type `*T`. Hence, if the database returns `NULL` for this field,
|
||||
the struct field will be `nil`. Otherwise, it will contains a pointer to the actual data.
|
||||
the struct field will be `nil`. Otherwise, it will contain a pointer to the actual data.
|
||||
|
||||
For example, given this schema:
|
||||
```go
|
||||
|
||||
Reference in New Issue
Block a user