$ open source · GPL-3.0 — need a commercial license? imqueue.com →

QueryInterface interface

Sequelize's query interface, extended with view creation and removal.

Signature:

export interface QueryInterface extends QueryInterfaceOrigin 

Extends: QueryInterfaceOrigin

Remarks

The type a migration works against, and the most imported symbol in this package. Everything sequelize's own interface offers is here unchanged; createView and dropView are the additions, since sequelize has no equivalent.

The instance handed out by Sequelize.getQueryInterface() is also wrapped in three ways that do not show up in this type: every write method treats an empty returning array as false, query() rewrites RETURNING * when given a column list, and the select-query generator substitutes a dynamic view's definition into the statement.

Properties

Property

Modifiers

Type

Description

sequelize

Sequelize

The connection this interface belongs to.

Methods

Method

Description

createView(viewName, viewDefinition)

Creates a view from a complete SQL definition.

dropView(viewName, options)

Drops a view, if it exists.