import { LambdaAbortedError } from "./errors/Errors" ; import { Result } from "./Result" ; import { ResultReadable } from "./ResultReadable" ; import { Transaction } from "./Transaction" ; /**
 * A class to handle lambda execution.
 */ export class TransactionExecutor { private _transaction : Transaction ; param transaction internal constructor ( transaction ) { this . _transaction = transaction ; } throws abort ( ) { throw new LambdaAbortedError ( ) ; } /**
     * Execute the specified statement in the current transaction. This method returns a promise
     * which eventually returns all the results loaded into memory.
     *
     * The PartiQL statement executed via this transaction is not immediately committed.
     * The entire transaction will be committed once the all the code in `transactionFunction`
     * (passed as an argument to  QldbDriver . executeLambda ) completes.
     *
     *  param statement param parameters returns throws async execute ( statement , ... parameters ) { return await this . _transaction . execute ( statement , ... parameters ) ; } /**
     * Execute the specified statement in the current transaction. This method returns a promise
     * which fulfills with Readable interface, which allows you to stream one record at time
     *
     * The PartiQL statement executed via this transaction is not immediately committed.
     * The entire transaction will be committed once the all the code in `transactionFunction`
     * (passed as an argument to  QldbDriver . executeLambda ) completes.
     *
     *  param statement param parameters returns throws throws async executeAndStreamResults ( statement , ... parameters ) { return await this . _transaction . executeAndStreamResults ( statement , ... parameters ) ; } returns getTransactionId ( ) { return this . _transaction . getTransactionId ( ) ; } }