Documentation
    Preparing search index...

    Interface SequelizeCoreOptions<Dialect>

    Options of the Sequelize constructor used by the core library.

    See Options for the full list of options, including those dialect-specific.

    interface SequelizeCoreOptions<Dialect extends AbstractDialect> {
        benchmark?: boolean;
        databaseVersion?: string;
        defaultTimestampPrecision?: number | null;
        defaultTransactionNestMode?: TransactionNestMode;
        define?: Omit<
            ModelOptions<Model<any, any>>,
            "name" | "tableName" | "modelName",
        >;
        dialect: Class<Dialect>;
        disableClsTransactions?: boolean;
        hooks?: Partial<SequelizeHooks<Dialect>>;
        isolationLevel?: IsolationLevel;
        keepDefaultTimezone?: boolean;
        logging?: false | ((sql: string, timing?: number) => void);
        logQueryParameters?: boolean;
        minifyAliases?: boolean;
        models?: ModelStatic[];
        noTypeValidation?: boolean;
        nullJsonStringification?: "explicit" | "json" | "sql";
        omitNull?: boolean;
        pool?: PoolOptions<Dialect>;
        prependSearchPath?: boolean;
        query?: QueryOptions;
        quoteIdentifiers?: boolean;
        replication?: false | Nullish | ReplicationOptions<Dialect>;
        retry?: Options;
        schema?: string;
        set?: DefaultSetOptions;
        sync?: SyncOptions;
        timezone?: string;
        transactionType?: TransactionType;
        url?: string;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index
    benchmark?: boolean

    Pass query execution time in milliseconds as second argument to logging function (options.logging).

    databaseVersion?: string

    The version of the Database Sequelize will connect to. If unspecified, or set to 0, Sequelize will retrieve it during its first connection to the Database.

    defaultTimestampPrecision?: number | null

    The precision for the createdAt/updatedAt/deletedAt DATETIME columns that Sequelize adds to models. Can be a number between 0 and 6, or null to use the default precision of the database. Defaults to 6.

    6
    
    defaultTransactionNestMode?: TransactionNestMode

    How nested transaction blocks behave by default. See ManagedTransactionOptions#nestMode for more information.

    TransactionNestMode.reuse
    
    define?: Omit<ModelOptions<Model<any, any>>, "name" | "tableName" | "modelName">

    Default options for model definitions. See Model.init.

    dialect: Class<Dialect>

    The dialect of the database you are connecting to. Pass the Dialect class exported by the dialect package.

    disableClsTransactions?: boolean

    Disable the use of AsyncLocalStorage to automatically pass transactions started by Sequelize#transaction. You will need to pass transactions around manually if you disable this.

    Sets global permanent hooks.

    isolationLevel?: IsolationLevel

    Set the default transaction isolation level. If not set, does not change the database's default transaction isolation level.

    keepDefaultTimezone?: boolean

    A flag that defines if the default timezone is used to convert dates from the database.

    false
    
    logging?: false | ((sql: string, timing?: number) => void)

    A function that gets executed while running the query to log the sql.

    logQueryParameters?: boolean

    Set to true to show bind parameters in log.

    false
    
    minifyAliases?: boolean

    Set to true to automatically minify aliases generated by sequelize. Mostly useful to circumvent the POSTGRES alias limit of 64 characters.

    false
    
    models?: ModelStatic[]

    A list of models to load and init.

    This option is only useful if you created your models using decorators. Models created using Model.init or Sequelize#define don't need to be specified in this option.

    Use @sequelize/core!importModels to load models dynamically:

    import { User } from './models/user.js';

    new Sequelize({
    models: [User],
    });
    new Sequelize({
    models: await importModels(__dirname + '/*.model.ts'),
    });
    noTypeValidation?: boolean

    Disable built in type validators on insert and update, e.g. don't validate that arguments passed to integer fields are integer-like.

    false
    
    nullJsonStringification?: "explicit" | "json" | "sql"

    When representing the JavaScript null primitive in a JSON column, Sequelize can use either the SQL NULL value, or a JSON 'null'.

    Set this to "json" if you want the null to be stored as a JSON 'null'. Set this to "sql" if you want the null to be stored as the SQL NULL value. Set this to "explicit" if you don't want Sequelize to make any assumptions. This means that you won't be able to use the JavaScript null primitive as the top level value of a JSON column, you will have to use @sequelize/core!SQL_NULL or @sequelize/core!JSON_NULL instead.

    This only impacts serialization when inserting or updating values. Comparing always requires to be explicit.

    Read more: https://sequelize.org/docs/v7/querying/json/

    json
    
    omitNull?: boolean

    A flag that defines if null values should be passed to SQL queries or not.

    false
    

    Connection pool options

    prependSearchPath?: boolean
    query?: QueryOptions

    Default options for sequelize.query

    quoteIdentifiers?: boolean

    Set to false to make table names and attributes case-insensitive on Postgres and skip double quoting of them.

    true
    
    replication?: false | Nullish | ReplicationOptions<Dialect>

    Use read / write replication. To enable replication, pass an object, with two properties, read and write. Write should be an object (a single server for handling writes), and read an array of object (several servers to handle reads). Each read/write server can have the following properties: host, port, username, password, database. Connection strings can be used instead of objects.

    false
    
    retry?: Options
    schema?: string

    If defined, the connection will use the provided schema instead of the default ("public").

    Default options for sequelize.set

    Default options for sequelize.sync

    timezone?: string

    The timezone used when converting a date from the database into a JavaScript date. The timezone is also used to SET TIMEZONE when connecting to the server, to ensure that the result of NOW, CURRENT_TIMESTAMP and other time related functions have in the right timezone. For best cross platform performance use the format +/-HH:MM. Will also accept string versions of timezones supported by Intl.Locale (e.g. 'America/Los_Angeles'); this is useful to capture daylight savings time changes.

    '+00:00'
    
    transactionType?: TransactionType

    Set the default transaction type. See Sequelize.Transaction.TYPES for possible options. Sqlite only.

    'DEFERRED'
    
    url?: string

    The connection URL. If other connection options are set, they will override the values set in this URL.