FieldModel
FieldModel =
object
Defined in: packages/schema/src/model.ts:12
A field of a resource as the server and the app see it, built from its f.* builder and options; see
Field options.
Properties
Section titled “Properties”
optionalai?:object
Defined in: packages/schema/src/model.ts:53
A job fills it from the prompt after a create or an update of a field the prompt names (.ai()).
prompt
Section titled “prompt”prompt:
string
The prompt, with {field} placeholders.
aliases
Section titled “aliases”aliases:
string[]
Defined in: packages/schema/src/model.ts:28
Other names filters may use for the field (.alias()).
column
Section titled “column”column:
string
Defined in: packages/schema/src/model.ts:16
The table column it reads and writes: the snake_case of the name unless .column() says otherwise.
default?
Section titled “default?”
optionaldefault?: {value:unknown; } | {db:true; }
Defined in: packages/schema/src/model.ts:41
A value the form prefills, or db when the database supplies it (identity, now(), …).
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ value: unknown; }
value:
unknown
The value a create uses when none is given (.default()).
Type Literal
Section titled “Type Literal”{ db: true; }
db:
true
The database supplies the value (.dbDefault()).
enumValues?
Section titled “enumValues?”
optionalenumValues?:string[]
Defined in: packages/schema/src/model.ts:30
An enum’s values, in order.
optionalfile?:FileFieldModel
Defined in: packages/schema/src/model.ts:51
A file field’s allowed types (empty: any), largest upload in bytes, provider, and what each upload writes.
filterable
Section titled “filterable”filterable:
boolean
Defined in: packages/schema/src/model.ts:24
May appear in filters and filter widgets (.filterable()).
name:
string
Defined in: packages/schema/src/model.ts:14
The field’s name: in URLs, the API, filters and sorts.
nullable
Section titled “nullable”nullable:
boolean
Defined in: packages/schema/src/model.ts:20
Whether the value may be null (.optional()).
readOnly
Section titled “readOnly”readOnly:
boolean
Defined in: packages/schema/src/model.ts:22
Never written through the API (.readOnly()).
relation?
Section titled “relation?”
optionalrelation?:object
Defined in: packages/schema/src/model.ts:32
A relation’s target.
columns
Section titled “columns”columns:
string[]
The columns of this table holding the other record’s key, in the order of that key.
resource
Section titled “resource”resource:
string
The resource it points at.
sensitive?
Section titled “sensitive?”
optionalsensitive?:true
Defined in: packages/schema/src/model.ts:39
Never sent with the record; revealed one value at a time (.sensitive()).
sortable
Section titled “sortable”sortable:
boolean
Defined in: packages/schema/src/model.ts:26
May appear in order_by and sorts (.sortable()).
type:
FieldType
Defined in: packages/schema/src/model.ts:18
Its storage type.