Skip to main content
Version: 0.3.0

TransactionManager

age-schema-client v0.3.0


age-schema-client / TransactionManager

Class: TransactionManager

Defined in: src/db/transaction.ts:415

Transaction manager class

Constructors

Constructor

new TransactionManager(connection): TransactionManager;

Defined in: src/db/transaction.ts:423

Create a new transaction manager

Parameters

ParameterTypeDescription
connectionConnectionDatabase connection

Returns

TransactionManager

Methods

beginTransaction()

beginTransaction(options): Promise<Transaction>;

Defined in: src/db/transaction.ts:433

Begin a new transaction

Parameters

ParameterTypeDescription
optionsTransactionOptionsTransaction options

Returns

Promise<Transaction>

Transaction


withTransaction()

withTransaction<T>(callback, options): Promise<T>;

Defined in: src/db/transaction.ts:446

Execute a function within a transaction

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
callback(transaction) => Promise<T>Function to execute
optionsTransactionOptionsTransaction options

Returns

Promise<T>

Result of the callback function


withAgeTransaction()

withAgeTransaction<T>(callback, options): Promise<T>;

Defined in: src/db/transaction.ts:485

Execute a function within a transaction with Apache AGE support

This method ensures that Apache AGE is loaded and in the search path before executing the callback function.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
callback(transaction) => Promise<T>Function to execute
optionsTransactionOptionsTransaction options

Returns

Promise<T>

Result of the callback function


ensureAgeSetup()

ensureAgeSetup(): Promise<void>;

Defined in: src/db/transaction.ts:523

Ensure Apache AGE is loaded and in the search path

Returns

Promise<void>

Promise that resolves when AGE is loaded and in the search path

Throws

Error if AGE cannot be loaded or added to the search path


getCurrentIsolationLevel()

getCurrentIsolationLevel(): Promise<IsolationLevel>;

Defined in: src/db/transaction.ts:558

Get the current isolation level

Returns

Promise<IsolationLevel>

Current isolation level