Skip to content

FieldOptions

Defined in: define/field/types.ts:23

Defines the common options available for all field types. These are used by the Field builder methods.

optional assert: string

Defined in: define/field/types.ts:25

A SurrealQL ASSERT clause to enforce a constraint on the field value.


optional comment: string

Defined in: define/field/types.ts:35

A comment to add to the field definition in the database schema.


optional default: string

Defined in: define/field/types.ts:27

A default value for the field, specified as a SurrealQL expression string.


optional permissions: string | FieldPermissionsOptions

Defined in: define/field/types.ts:33

Field-level permissions, specified as a raw string or a FieldPermissionsOptions object.


optional readonly: boolean

Defined in: define/field/types.ts:31

If true, the field cannot be modified after creation.


optional value: string

Defined in: define/field/types.ts:29

A SurrealQL VALUE clause to compute the field’s value upon write.