FieldModel
FieldModel =
object
Defined in: packages/schema/src/model.ts:17
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:70
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:33
Other names filters may use for the field (.alias()).
column
Section titled “column”column:
string
Defined in: packages/schema/src/model.ts:21
The table column it reads and writes: the snake_case of the name unless .column() says otherwise.
decimal?
Section titled “decimal?”
optionaldecimal?:object
Defined in: packages/schema/src/model.ts:81
A rollup’s or formula’s decimal, for the column protobase migration adds.
precision
Section titled “precision”precision:
number
Its number of digits.
scale:
number
Its number of digits after the point.
default?
Section titled “default?”
optionaldefault?: {value:unknown; } | {db:true; }
Defined in: packages/schema/src/model.ts:58
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()).
encrypted?
Section titled “encrypted?”
optionalencrypted?:true
Defined in: packages/schema/src/model.ts:46
Stored encrypted, and sensitive too (.encrypted()).
enumValues?
Section titled “enumValues?”
optionalenumValues?:string[]
Defined in: packages/schema/src/model.ts:35
An enum’s values, in order.
optionalfile?:FileFieldModel
Defined in: packages/schema/src/model.ts:68
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:29
May appear in filters and filter widgets (.filterable()).
formula?
Section titled “formula?”
optionalformula?:string
Defined in: packages/schema/src/model.ts:77
The database computes it from the record’s other fields (.formula()).
lookup?
Section titled “lookup?”
optionallookup?:Lookup
Defined in: packages/schema/src/model.ts:79
A lookup field: the linked record’s field it shows, which has no column of this table (.lookup()).
name:
string
Defined in: packages/schema/src/model.ts:19
The field’s name: in URLs, the API, filters and sorts.
nullable
Section titled “nullable”nullable:
boolean
Defined in: packages/schema/src/model.ts:25
Whether the value may be null (.optional()).
readOnly
Section titled “readOnly”readOnly:
boolean
Defined in: packages/schema/src/model.ts:27
Never written through the API (.readOnly()).
relation?
Section titled “relation?”
optionalrelation?:object
Defined in: packages/schema/src/model.ts:37
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.
rollup?
Section titled “rollup?”
optionalrollup?:Rollup
Defined in: packages/schema/src/model.ts:75
The database keeps it from the records of another resource (.rollup()).
sensitive?
Section titled “sensitive?”
optionalsensitive?:true
Defined in: packages/schema/src/model.ts:44
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:31
May appear in order_by and sorts (.sortable()).
strongSignIn?
Section titled “strongSignIn?”
optionalstrongSignIn?:object
Defined in: packages/schema/src/model.ts:48
Its reveal needs a strong sign-in this recent, and it is sensitive too (.strongSignIn()).
minutes
Section titled “minutes”minutes:
number
The most minutes since the sign-in, or its confirmation, proved a passkey or a second step.
type:
FieldType
Defined in: packages/schema/src/model.ts:23
Its storage type.
writeOnly?
Section titled “writeOnly?”
optionalwriteOnly?:true
Defined in: packages/schema/src/model.ts:56
In /meta only: the caller may write the field but not read it, as its own .access() write rule allows. It comes
sensitive, with no value to reveal, and the form edits it only where the view’s layout names it.