Class Transaction

The transaction object is used to identify a running transaction. It is created by calling Sequelize.transaction().

To run a query under a transaction, you should pass the transaction in the options object.

Hierarchy

  • Transaction

Constructors

Accessors

Methods

Constructors

  • Parameters

    Returns Transaction

Accessors

  • get LOCK(): typeof LOCK
  • Same as its static version, but can also be called on instances of transactions to get possible options for row locking directly from the instance.

    Returns typeof LOCK

  • get LOCK(): typeof LOCK
  • Returns possible options for row locking

    Returns typeof LOCK

Methods

  • Adds hook that is run after a transaction is committed

    Parameters

    • fn: ((transaction) => void | Promise<void>)
        • (transaction): void | Promise<void>
        • Parameters

          Returns void | Promise<void>

    Returns void

  • Commit the transaction

    Returns Promise<void>

  • Rollback (abort) the transaction

    Returns Promise<void>

Generated using TypeDoc