Skip to content

postgrelize / WriteStatement

Interface: WriteStatement ​

Defined in: src/expressions/query-expressions.ts:143

INSERT, UPDATE or DELETE statement for a data-modifying CTE. Created by Model.insertStatement(), Model.updateStatement() and Model.deleteStatement(); not executed on its own. PostgreSQL extension.

Example ​

ts
const moved = Task.deleteStatement({ where: { done: true }, returning: true });
const rows = await Task.findAll({ with: { moved }, source: 'moved' });

Properties ​

build ​

readonly build: () => ModifyingNode

Defined in: src/expressions/query-expressions.ts:145

Builds the statement AST (called when the outer statement is compiled).

Returns ​

ModifyingNode

Released under the MIT License.