Field Reference

See relational fields at: Relations Reference

Field Options

The following options are available to all field types and are optional.


If true, this field will be the primary key for identifying records in the table. ManyToMany tables will use this primary key as it’s point of reference.

All tables must have at least ONE primary key.


If true, this field MUST be defined as something other than null or undefined when saved.

Field Types

Fields are specified by type in the schema. The type is case insensitive, and in some cases allow for abbreviated versions of the field’s formal name.


Matching Types: str, string, text

A string field, for small to large sized strings. This is the only field type you can use for representing a primary key, which ideally would be similar to a UUID in structure to prevent collisions.


Matching Types: int, integer

An integer field, returned and saved as a Javascript number.


Matching Types: bool, boolean

A boolean field, representing a true, false or undefined value.


Matching Types: json

A field that can represent any Javascript object literal. When stored in the database it will be serialised using JSON.stringify() and retrieved using JSON.parse().

JSON field types are not indexed, so their ideal use is as a non searchable element of your database.


Matching Types: datetime

A field representing a DateTime. Can be saved as any value that can be parsed by the library, however it will ALWAYS be returned as a moment for continuity. Timezone information is maintained when saving.


Matching Types: date

A field representing a Date with no timezone information. As with DateTime, it is wrapped with when returned.


Matching Types: time

A field representing a Time with timezone information. As with DateTime, it is wrapped with when returned.