Query context provider for knex (postgres).

Hierarchy

  • default
    • PostgresEntityQueryContextProvider

Constructors

Methods

  • Vend a transaction runner for use in runInTransactionAsync.

    Type Parameters

    • T

    Parameters

    • OptionaltransactionConfig: TransactionConfig

    Returns (transactionScope: (trx: any) => Promise<T>) => Promise<T>

  • Vend a regular (non-transactional) entity query context.

    Returns EntityNonTransactionalQueryContext

  • Start a nested transaction from the specified parent transaction and execure the provided nested-transaction-scoped closure within the nested transaction.

    Type Parameters

    • T

    Parameters

    • outerQueryContext: EntityTransactionalQueryContext

      the query context of the parent transaction

    • transactionScope: (innerQueryContext: EntityNestedTransactionalQueryContext) => Promise<T>

      async callback to execute within the nested transaction

    Returns Promise<T>

  • Start a transaction and execute the provided transaction-scoped closure within the transaction.

    Type Parameters

    • T

    Parameters

    • transactionScope: (queryContext: EntityTransactionalQueryContext) => Promise<T>

      async callback to execute within the transaction

    • OptionaltransactionConfig: TransactionConfig

    Returns Promise<T>