Skip to content
🚀 This documentation is for unreal-orm 1.0.0 alpha which requires SurrealDB 2.0 alpha SDK. For the stable version, see npm.

FieldOptions

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

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

optional assert: BoundQuery<unknown[]> | Expr

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

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


optional comment: string

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

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


optional default: BoundQuery<unknown[]> | Expr

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

A default value for the field, specified as a SurrealQL expression BoundQuery or Expr.


optional permissions: FieldPermissionsOptions | BoundQuery<unknown[]> | Expr

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

Field-level permissions, specified as a BoundQuery/Expr object or a FieldPermissionsOptions object.


optional readonly: boolean

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

If true, the field cannot be modified after creation.


optional value: BoundQuery<unknown[]> | Expr

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

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