Skip to main content
Module

x/neo4j_driver_lite/mod.ts>TransactionPromise

Neo4j Bolt driver for JavaScript
Go to Latest
class TransactionPromise
implements Promise<Transaction>
extends Transaction
Re-export
import { TransactionPromise } from "https://deno.land/x/neo4j_driver_lite@5.14.0-alpha01/mod.ts";

Represents a Promise object and a Transaction object.

Resolving this object promise verifies the result of the transaction begin and returns the Transaction object in case of success.

The object can still also used as Transaction for convenience. The result of begin will be checked during the next API calls in the object as it is in the transaction.

Constructors

new
TransactionPromise(unnamed 0: { connectionHolder: ConnectionHolder; onClose: () => void; onBookmarks: (
newBookmarks: Bookmarks,
previousBookmarks: Bookmarks,
database?: string,
) => void; onConnection: () => void; reactive: boolean; fetchSize: number; impersonatedUser?: string; highRecordWatermark: number; lowRecordWatermark: number; notificationFilter?: NotificationFilter; apiTelemetryConfig?: NonAutoCommitApiTelemetryConfig; }
)

Properties

private
optional
_beginError: Error
private
optional
_beginMetadata: any
private
optional
_beginPromise: Promise<Transaction>
private
optional
_reject: (error: Error) => void
private
optional
_resolve: (value: Transaction | PromiseLike<Transaction>) => void
[Symbol.toStringTag]: string

Methods

private
_onBeginError(error: Error): void
private
_onBeginMetadata(metadata: any): void
_begin(bookmarks: () => Promise<Bookmarks>, txConfig: TxConfig): void
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<any>

Catch errors when using promises.

finally(onfinally?: (() => void) | null): Promise<Transaction>

Called when finally the begin is done

then<TResult1 = Transaction, TResult2 = never>(onfulfilled?: ((value: Transaction) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>

Waits for the begin to complete.