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
Adds constraints to a table
Adds a new index to a table
Pass query execution time in milliseconds as second argument to logging function (options.logging).
Either 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.
PostgreSQL will build the index without taking any write locks. Postgres only.
Map returned fields to arbitrary names for SELECT query type if options.fieldMaps
is present.
The fields to index.
A sequelize instance used to build the return instance
A function that gets executed while running the query to log the sql.
Map returned fields to model's fields if options.model
or options.instance
is present.
Mapping will occur before building the model instance.
The name of the index. Defaults to model name + _ + fields concatenated
If 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
Index operator type. Postgres only
For FULLTEXT columns set your parser
Sets the query type to SELECT
and return a single row
Prefix to append to the index name.
If true, sequelize will not try to format the results of the query, or build an instance of a model from the result
Only named replacements are allowed in query interface methods.
The 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.
Index type. Only used by mysql. One of UNIQUE
, FULLTEXT
and SPATIAL
Should the index by unique? Can also be triggered by setting type to UNIQUE
Force the query to use the write pool, regardless of the query type.
The 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 parameter for index. Can be used to limit the index to certain rows.
Deletes multiple rows at once
Inserts multiple records at once
Updates multiple rows at once
Changes a column
Commit an already started transaction
Creates a database
Postgres only. Create a function
Queries the schema (table list).
The schema to query. Applies only to Postgres.
Creates a table with specified attributes.
Name of table to create
Hash of attributes, key is attribute name, value is data type
Table options.
Postgres only. Creates a trigger on specified table to call the specified function with supplied parameters.
Return database version
Decrements a row value
Defer constraints
Deletes a row
Describe a table
Drops all defined enums
Drops all tables.
Drops all tables.
Creates a database
Postgres only. Drops a function
Drops the specified schema (table).
The schema to query. Applies only to Postgres.
Drops the specified table.
Table name.
Query options, particularly "force".
Postgres only. Drops the specified trigger.
Get foreign key references details for the table
Returns all foreign key constraints of requested tables
Increments a row value
Inserts a new record
Put a name to an index
Escape an identifier (e.g. a table or attribute name). If force is true, the identifier will be quoted
even if the quoteIdentifiers
option is false.
Split an identifier into .-separated tokens and quote each part.
Selects raw without parsing the string into an object
Removes a column from a table
Removes constraints from a table
Removes an index of a table
Renames a column
Postgres only. Rename a function
Renames a table
Postgres only. Renames a trigger
Rollback ( revert ) a transaction that has'nt been commited
Returns selected rows
Set option for autocommit of a transaction
Set the isolation level of a transaction
Queries all table names in the database.
Returns all tables
Shows the index of a table
Begin a new transaction
Updates a row
Inserts or Updates a record in the database
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.