Skip to content

postgrelize / TransactionOptions

Type Alias: TransactionOptions ​

TransactionOptions = Readonly<{ deferrable?: boolean | DeferrableValue; isolationLevel?: IsolationLevel; logging?: LoggingFunction | false; readOnly?: boolean; retry?: RetryOptions; settings?: Readonly<Record<string, string | number | boolean>>; transaction?: Transaction | null; type?: typeof TRANSACTION_TYPES[keyof typeof TRANSACTION_TYPES]; }>

Defined in: src/transaction/transaction.ts:41

Options of sequelize.transaction().

All fields are optional.

Example ​

ts
const options: TransactionOptions = {
  isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE,
  readOnly: true,
  deferrable: true,
  settings: { 'app.user_id': '42', statement_timeout: '5s' },
};
const t = await sequelize.transaction(options);
await t.commit();

Released under the MIT License.