@storehouse/sequelize - v2.0.0
    Preparing search index...

    Interface ModelSettings<TModelAttributes, TCreationAttributes>

    Configuration settings for a Sequelize model. Defines the attributes, model class, and options for a single model.

    const userModelSettings: ModelSettings = {
    attributes: {
    id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
    },
    name: {
    type: DataTypes.STRING,
    allowNull: false
    },
    email: {
    type: DataTypes.STRING,
    unique: true
    }
    },
    options: {
    modelName: 'User',
    tableName: 'users'
    }
    };
    interface ModelSettings<
        TModelAttributes extends AnyJsonObject = any,
        TCreationAttributes extends AnyJsonObject = TModelAttributes,
    > {
        attributes: ModelAttributes<
            Model<TModelAttributes, TCreationAttributes>,
            TModelAttributes,
        >;
        model?: ModelStatic<Model<TModelAttributes, TCreationAttributes>>;
        options?: ModelOptions<Model<TModelAttributes, TCreationAttributes>>;
    }

    Type Parameters

    • TModelAttributes extends AnyJsonObject = any

      The model attributes type, defaults to any JSON object

    • TCreationAttributes extends AnyJsonObject = TModelAttributes

      The creation attributes type, defaults to TModelAttributes

    Index

    Properties

    attributes: ModelAttributes<
        Model<TModelAttributes, TCreationAttributes>,
        TModelAttributes,
    >

    The model attribute definitions

    model?: ModelStatic<Model<TModelAttributes, TCreationAttributes>>

    Optional pre-defined model class that extends Sequelize Model

    options?: ModelOptions<Model<TModelAttributes, TCreationAttributes>>

    Model configuration options such as tableName, timestamps, etc.