Query context provider for knex (postgres).

Hierarchy

  • default
    • PostgresEntityQueryContextProvider

Constructors

Methods

  • Type Parameters

    • T

    Parameters

    • outerQueryInterface: any

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

      • (transactionScope): Promise<T>
      • Parameters

        • transactionScope: ((queryInterface: any) => Promise<T>)
            • (queryInterface): Promise<T>
            • Parameters

              • queryInterface: any

              Returns Promise<T>

        Returns Promise<T>

  • Vend a transaction runner for use in runInTransactionAsync.

    Type Parameters

    • T

    Parameters

    • OptionaltransactionConfig: TransactionConfig

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

      • (transactionScope): Promise<T>
      • Parameters

        • transactionScope: ((trx: any) => Promise<T>)
            • (trx): Promise<T>
            • Parameters

              • trx: any

              Returns Promise<T>

        Returns 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

        • (innerQueryContext): Promise<T>
        • Parameters

          • innerQueryContext: EntityNestedTransactionalQueryContext

          Returns Promise<T>

    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

        • (queryContext): Promise<T>
        • Parameters

          • queryContext: EntityTransactionalQueryContext

          Returns Promise<T>

    • OptionaltransactionConfig: TransactionConfig

    Returns Promise<T>