Interface UteStorageModels

Ute Storage Models Structure

interface UteStorageModels {
    allowNull?: boolean;
    autoIncrement?: boolean;
    defaultValue?: string | number;
    primaryKey?: boolean;
    references?: {
        key: string;
        model: string;
    };
    type: UteModelTypes;
    unique?: boolean;
}

Properties

allowNull?: boolean

Set field not allow "Empty" values

autoIncrement?: boolean

Use "Auto Increment" for field

defaultValue?: string | number

Default value for field if it`s empty on insert

primaryKey?: boolean

Set field as "Primary Key"

references?: {
    key: string;
    model: string;
}

Name of table & column to assotiation beetwen tables

"{ models: 'Table', key: 'Column' }"

Field type

unique?: boolean

Check if field unique in table (Always use if field - REFERENCES & not PRIMARY KEY)