Skip to main content
Module

x/neo4j_lite_client/core/index.ts>Transaction

Unofficial Neo4j Driver for Deno
Latest
class Transaction
Re-export
import { Transaction } from "https://deno.land/x/neo4j_lite_client@4.4.6/core/index.ts";

Represents a transaction in the Neo4j database.

Constructors

new
Transaction(unnamed 0: { connectionHolder: ConnectionHolder; onClose: () => void; onBookmark: (bookmark: Bookmark) => void; onConnection: () => void; reactive: boolean; fetchSize: number; impersonatedUser?: string; })

Properties

private
_connectionHolder: ConnectionHolder
private
_fetchSize: number
private
optional
_impersonatedUser: string
private
_onBookmark: (bookmark: Bookmark) => void
private
_onClose: () => void
private
_onComplete: (metadata: any) => void
private
_onConnection: () => void
private
_onError: (error: Error) => Promise<Connection | void>
private
_reactive: boolean
private
_results: any[]
private
_state: any

Methods

_begin(bookmark: Bookmark | string | string[], txConfig: TxConfig): void
_onCompleteCallback(meta: { bookmark?: string | string[]; }): void
_onErrorCallback(err: any): Promise<Connection | void>
close(): Promise<void>

Closes the transaction

This method will roll back the transaction if it is not already committed or rolled back.

commit(): Promise<void>

Commits the transaction and returns the result.

After committing the transaction can no longer be used.

isOpen(): boolean

Check if this transaction is active, which means commit and rollback did not happen.

rollback(): Promise<void>

Rollbacks the transaction.

After rolling back, the transaction can no longer be used.

run(query: Query, parameters?: any): Result

Run Cypher query Could be called with a query object i.e.: {text: "MATCH ...", parameters: {param: 1}} or with the query and parameters as separate arguments.