Skip to content

postgrelize / Deferrable

Variable: Deferrable ​

const Deferrable: object

Defined in: src/ddl/ddl-types.ts:49

Deferrable constraint modes (Sequelize v6 Deferrable).

Type Declaration ​

INITIALLY_DEFERRED ​

readonly INITIALLY_DEFERRED: Readonly<Readonly<{ sql: string; }>>

DEFERRABLE INITIALLY DEFERRED.

INITIALLY_IMMEDIATE ​

readonly INITIALLY_IMMEDIATE: Readonly<Readonly<{ sql: string; }>>

DEFERRABLE INITIALLY IMMEDIATE.

NOT ​

readonly NOT: Readonly<Readonly<{ sql: string; }>>

NOT DEFERRABLE.

SET_DEFERRED ​

readonly SET_DEFERRED: ConstraintModeSetter

SET CONSTRAINTS ... DEFERRED: for the deferrable option of sequelize.transaction(), defers the given constraints (all of them when used bare or called without names) for the rest of the transaction.

SET_IMMEDIATE ​

readonly SET_IMMEDIATE: ConstraintModeSetter

SET CONSTRAINTS ... IMMEDIATE: the counterpart of SET_DEFERRED.

Example ​

ts
await queryInterface.addColumn('posts', 'userId', {
  type: DataTypes.INTEGER,
  references: { model: 'Users', key: 'id', deferrable: Deferrable.INITIALLY_DEFERRED },
});

Released under the MIT License.