TransactionManager
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
| Parameter | Type | Description |
|---|---|---|
connection | Connection | Database connection |
Returns
TransactionManager
Methods
beginTransaction()
beginTransaction(options): Promise<Transaction>;
Defined in: src/db/transaction.ts:433
Begin a new transaction
Parameters
| Parameter | Type | Description |
|---|---|---|
options | TransactionOptions | Transaction 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
| Parameter | Type | Description |
|---|---|---|
callback | (transaction) => Promise<T> | Function to execute |
options | TransactionOptions | Transaction 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
| Parameter | Type | Description |
|---|---|---|
callback | (transaction) => Promise<T> | Function to execute |
options | TransactionOptions | Transaction 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