Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Options

Options for the constructor of the Sequelize main class.

Hierarchy

Index

Properties

benchmark?: boolean

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

clientMinMessages?: string | boolean

The PostgreSQL client_min_messages session parameter. Set to false to not override the database's default.

Deprecated in v7, please use the sequelize option "dialectOptions.clientMinMessages" instead

deprecated
default

'warning'

database?: string

The name of the database

define?: ModelOptions<Model<any, any>>

Default options for model definitions. See Model.init.

dialect?: Dialect

The dialect of the database you are connecting to. One of mysql, postgres, sqlite, mariadb and mssql.

default

'mysql'

dialectModule?: object

If specified, will use the provided module as the dialect.

example

dialectModule: require('@myorg/tedious'),

dialectModulePath?: string

If specified, load the dialect library from this path. For example, if you want to use pg.js instead of pg when connecting to a pg database, you should specify 'pg.js' here

dialectOptions?: object

An object of additional options, which are passed directly to the connection library

hooks?: Partial<SequelizeHooks<Model<any, any>, any, any>>

Sets global permanent hooks.

host?: string

The host of the relational database.

default

'localhost'

isolationLevel?: ISOLATION_LEVELS

Set the default transaction isolation level. See Sequelize.Transaction.ISOLATION_LEVELS for possible options.

default

'REPEATABLE_READ'

logQueryParameters?: boolean

Set to true to show bind parameters in log.

default

false

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

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

minifyAliases?: boolean

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

default

false

native?: boolean

A flag that defines if native library shall be used or not. Currently only has an effect for postgres

default

false

omitNull?: boolean

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

default

false

operatorsAliases?: OperatorsAliases

Sets available operator aliases. See (https://sequelize.org/docs/v7/core-concepts/model-querying-basics/#operators) for more information. WARNING: Setting this to boolean value was deprecated and is no-op.

default

all aliases

password?: string

The password which is used to authenticate against the database.

Connection pool options

port?: string | number

The port of the relational database.

protocol?: string

The protocol of the relational database.

default

'tcp'

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.

default

true

replication?: false | ReplicationOptions

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

default

false

retry?: RetryOptions
schema?: string

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

Default options for sequelize.set

ssl?: boolean

A flag that defines if is used SSL.

standardConformingStrings?: boolean

The PostgreSQL standard_conforming_strings session parameter. Set to false to not set the option. WARNING: Setting this to false may expose vulnerabilities and is not recommended!

default

true

storage?: string

Only used by sqlite.

default

':memory:'

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 used by moment.js (e.g. 'America/Los_Angeles'); this is useful to capture daylight savings time changes.

default

'+00:00'

transactionType?: TRANSACTION_TYPES

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

default

'DEFERRED'

typeValidation?: boolean

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

default

false

username?: string

The username which is used to authenticate against the database.

Generated using TypeDoc