interface ModelOptions {
    indexes?: IndexesDefinition;
    int8id?: boolean;
    parent?: Model;
    primaryKey?: string;
    sync?: boolean;
    tableName?: string;

Specifies the options for the Model.


  • default: {}

Defines the indexes of the Model. See IndexesDefinition for details.


  • default: false

If true, the implicit id attribute used as primary key is of type INT8, see Data types for details.


This option conflicts with ModelOptions.parent and ModelOptions.primaryKey ones.


  • default: undefined

If provided, defines the parent of the Model. This reflects both on classes hierarchy at JavaScript level and on tables hierarchy at database level. The primary key is inherited as well: neither an implicit id attribute is added nor can be specified through ModelOptions.primaryKey option.


Not all the database engine specialized packages may support this option.


This option conflicts with ModelOptions.int8id and ModelOptions.primaryKey ones.


  • default: undefined

The value must be the name of an attribute. If provided, defines the primary key of the Model. The implicit id attribute is not added to the Model.


This option conflicts with ModelOptions.int8id and ModelOptions.parent ones.


If false, Sedentary does not sync the table associated to the Model, it simply checks if the Model is compliant with the table at database level.


  • default: undefined

If not provided, the name of the table is tha name of the Model (i.e. the name argument of the sedentary.model() call), otherwise it overrides the default table name.