Options provided when the transaction is created

interface TransactionOptions {
    benchmark?: boolean;
    constraintChecking?: ConstraintChecking | Class<ConstraintChecking>;
    isolationLevel?: null | IsolationLevel;
    logging?: false | ((sql, timing?) => void);
    readOnly?: boolean;
    transaction?: null | Transaction;
    type?: TransactionType;
}

Hierarchy (view full)

Properties

benchmark?: boolean

Pass query execution time in milliseconds as second argument to logging function (options.logging).

constraintChecking?: ConstraintChecking | Class<ConstraintChecking>

Sets the constraints to be deferred or immediately checked. PostgreSQL only

isolationLevel?: null | IsolationLevel

Sets the isolation level of the transaction.

logging?: false | ((sql, timing?) => void)

A function that gets executed while running the query to log the sql.

Type declaration

    • (sql, timing?): void
    • Parameters

      • sql: string
      • Optional timing: number

      Returns void

readOnly?: boolean

Whether this transaction will only be used to read data. Used to determine whether sequelize is allowed to use a read replication server.

transaction?: null | Transaction

Parent transaction. Will be retrieved from CLS automatically if not provided or if null.

Sets the type of the transaction. Sqlite only