Returns the dialect-specific sql generator.
We don't have a definition for the QueryGenerator, because I doubt it is commonly in use separately.
Returns the current sequelize instance.
Adds a new column to a table
Optional
options: QiOptionsWithReplacementsAdds a new index to a table
Optional
options: QueryInterfaceIndexOptionsOptional
rawTablename: stringOptional
benchmark?: booleanPass query execution time in milliseconds as second argument to logging function (options.logging).
Optional
bind?: BindOrReplacementsEither an object of named parameter bindings in the format $param
or an array of unnamed
values to bind to $1
, $2
, etc in your SQL.
Optional
concurrently?: booleanPostgreSQL will build the index without taking any write locks. Postgres only.
false
Optional
fieldMap returned fields to arbitrary names for SELECT query type if options.fieldMaps
is present.
The fields to index.
Optional
instance?: Model<any, any>A sequelize instance used to build the return instance
Optional
logging?: boolean | ((sql: string, timing?: number) => void)A function that gets executed while running the query to log the sql.
Optional
mapMap returned fields to model's fields if options.model
or options.instance
is present.
Mapping will occur before building the model instance.
Optional
name?: stringThe name of the index. Defaults to model name + _ + fields concatenated
Optional
nest?: booleanIf true, transforms objects with .
separated property names into nested objects using
dottie.js. For example { 'user.username': 'john' } becomes
{ user: { username: 'john' }}. When nest
is true, the query type is assumed to be 'SELECT'
,
unless otherwise specified
false
Optional
operator?: stringIndex operator type. Postgres only
Optional
parser?: null | stringFor FULLTEXT columns set your parser
Optional
plain?: booleanSets the query type to SELECT
and return a single row
Optional
prefix?: stringPrefix to append to the index name.
Optional
raw?: booleanIf true, sequelize will not try to format the results of the query, or build an instance of a model from the result
Optional
replacements?: { Only named replacements are allowed in query interface methods.
Optional
retry?: RetryOptionsOptional
transaction?: null | TransactionThe transaction in which this query must be run.
If CLS is enabled and a transaction is running in the current CLS context, that transaction will be used, unless null or a Transaction is manually specified here.
Optional
type?: IndexTypeIndex type. Only used by mysql. One of UNIQUE
, FULLTEXT
and SPATIAL
Optional
unique?: booleanShould the index by unique? Can also be triggered by setting type to UNIQUE
false
Optional
useForce the query to use the write pool, regardless of the query type.
false
Optional
using?: stringThe method to create the index by (USING
statement in SQL).
BTREE and HASH are supported by mysql and postgres.
Postgres additionally supports GIST, SPGIST, BRIN and GIN.
Optional
where?: WhereOptions<any>Optional where parameter for index. Can be used to limit the index to certain rows.
Optional
rawTablename: stringDeletes multiple rows at once
Optional
options: QiOptionsWithReplacementsOptional
model: ModelStatic<Model<any, any>>Inserts multiple records at once
Optional
options: QiOptionsWithReplacementsOptional
attributes: Record<string, ModelAttributeColumnOptions<Model<any, any>>>Updates multiple rows at once
Optional
options: QiOptionsWithReplacementsOptional
columnDefinitions: { Changes a column
Optional
dataTypeOrOptions: DataTypes.DataType | ModelAttributeColumnOptions<Model<any, any>>Optional
options: QiOptionsWithReplacementsCommit an already started transaction
Optional
options: QueryRawOptionsCreates a database
Optional
options: CreateDatabaseOptionsPostgres only. Create a function
Optional
optionsArray: string[]Optional
options: CreateFunctionOptionsQueries the schema (table list).
Optional
schema: stringThe schema to query. Applies only to Postgres.
Optional
options: QueryRawOptionsCreates a table with specified attributes.
Name of table to create
Hash of attributes, key is attribute name, value is data type
Optional
options: QueryInterfaceCreateTableOptionsTable options.
Postgres only. Creates a trigger on specified table to call the specified function with supplied parameters.
Optional
options: QiOptionsWithReplacementsReturn database version
Optional
options: QueryRawOptionsDecrements a row value
Optional
extraAttributesToBeUpdated: objectOptional
where: WhereOptions<Attributes<M>>Optional
options: QiArithmeticOptionsDefer constraints
Optional
options: QueryRawOptionsDeletes a row
Optional
options: QiDeleteOptionsDescribe a table
Drops all defined enums
Optional
options: QueryRawOptionsDrops all tables.
Optional
options: QueryInterfaceDropAllTablesOptionsDrops all tables.
Optional
options: QueryInterfaceDropAllTablesOptionsCreates a database
Optional
options: QueryRawOptionsPostgres only. Drops a function
Optional
options: QiOptionsWithReplacementsDrops the specified schema (table).
Optional
schema: stringThe schema to query. Applies only to Postgres.
Optional
options: QueryRawOptionsDrops the specified table.
Table name.
Optional
options: QueryInterfaceDropTableOptionsQuery options, particularly "force".
Postgres only. Drops the specified trigger.
Optional
options: QiOptionsWithReplacementsGet foreign key references details for the table
Optional
options: QueryRawOptionsReturns all foreign key constraints of requested tables
Optional
options: QueryRawOptionsIncrements a row value
Optional
extraAttributesToBeUpdated: objectOptional
where: WhereOptions<Attributes<M>>Optional
options: QiArithmeticOptionsInserts a new record
Optional
options: QiInsertOptionsLists all available databases
Optional
options: QueryRawOptionsSelects raw without parsing the string into an object
Optional
model: ModelStatic<Model<any, any>>Removes a column from a table
Optional
options: QiOptionsWithReplacementsRemoves constraints from a table
Optional
options: QueryRawOptionsRemoves an index of a table
Optional
options: QueryInterfaceIndexOptionsOptional
options: QueryInterfaceIndexOptionsRenames a column
Optional
options: QiOptionsWithReplacementsPostgres only. Rename a function
Optional
options: QiOptionsWithReplacementsRenames a table
Optional
options: QueryRawOptionsPostgres only. Renames a trigger
Optional
options: QiOptionsWithReplacementsRollback ( revert ) a transaction that has'nt been commited
Optional
options: QueryRawOptionsReturns selected rows
Optional
options: QiSelectOptionsSet option for autocommit of a transaction
Optional
options: QueryRawOptionsSet the isolation level of a transaction
Optional
options: QueryRawOptionsQueries all table names in the database.
Optional
options: QueryRawOptionsReturns all tables
Optional
options: QueryRawOptionsShows the index of a table
Optional
options: QueryRawOptionsBegin a new transaction
Optional
options: QueryRawOptionsReturns a promise that resolves to true if the table exists in the database, false otherwise.
The name of the table
Optional
options: QueryRawOptionsOptions passed to query
Updates a row
Optional
options: QiUpdateOptionsInserts or Updates a record in the database
Optional
options: QiUpsertOptions<M>Generated using TypeDoc
The interface that Sequelize uses to talk to all databases.
This interface is available through sequelize.queryInterface. It should not be commonly used, but it's referenced anyway, so it can be used.