Skip to content

Field

Defined in: packages/schema/src/field.ts:85

A field of a resource, holding values of type V, as f builds it. Every option returns a new field, so they chain in any order. See Field options.

V

readonly def: FieldTypeDef

Defined in: packages/schema/src/field.ts:91

Its field type.


readonly meta: FieldMeta

Defined in: packages/schema/src/field.ts:93

What its builder methods have set.


readonly schema: ZodType<V>

Defined in: packages/schema/src/field.ts:87

The Zod schema a value is checked with on every create and update: the type’s, nullable and defaulted as set.

access(rules): Field<V>

Defined in: packages/schema/src/field.ts:126

Role-based rules for reading and writing this column. They never see a record, so the set of readable columns is fixed per request. A field without a rule follows its resource.

FieldAccess

Field<V>


ai(o): Field<V>

Defined in: packages/schema/src/field.ts:177

A job fills the field from prompt, {field} replaced by the record’s values, after a create, and after an update that changes a field the prompt names, as the user who wrote; see AI fields and actions.

string

Field<V>


alias(…names): Field<V>

Defined in: packages/schema/src/field.ts:144

Other names filters may use for the field.

…string[]

Field<V>


column(name): Field<V>

Defined in: packages/schema/src/field.ts:103

The column, when it is not the snake_case of the field’s name, such as 'EMP_NAME'.

string

Field<V>


dbDefault(): Field<V>

Defined in: packages/schema/src/field.ts:139

The database supplies a value when none is given (identity, now(), …).

Field<V>


default(value): Field<V>

Defined in: packages/schema/src/field.ts:118

The value a create uses when none is given; the admin’s create form shows it.

V

Field<V>


filterable(): Field<V>

Defined in: packages/schema/src/field.ts:149

The field may appear in filter, in filter widgets and in the filters of composed pages. Give it an index.

Field<V>


max(value): Field<V>

Defined in: packages/schema/src/field.ts:169

The greatest value of an integer, or the longest length of a text. Only f.integer() and f.text() take it.

number

Field<V>


min(value): Field<V>

Defined in: packages/schema/src/field.ts:164

The least value of an integer, or the shortest length of a text. Only f.integer() and f.text() take it.

number

Field<V>


optional(): Field<V | null>

Defined in: packages/schema/src/field.ts:113

The column is nullable: the value may be null.

Field<V | null>


readOnly(): Field<V>

Defined in: packages/schema/src/field.ts:108

Never written through the API: ids, computed columns, audit timestamps.

Field<V>


regex(re, message): Field<V>

Defined in: packages/schema/src/field.ts:159

Text must match re; a value that does not gets an issue with message. Only f.text() takes it.

RegExp

string

Field<V>


sensitive(): Field<V>

Defined in: packages/schema/src/field.ts:134

Hidden like a password: never part of a list, record, search or write response. A caller who may read it fetches the value of one record on its own (POST /{resource}/{key}:reveal), and every reveal is published as an audit event.

Field<V>


sortable(): Field<V>

Defined in: packages/schema/src/field.ts:154

The field may appear in order_by and in sorts.

Field<V>