@liberation-data/drivine
Version:
Best and fastest graph database client for TypeScript / Node.js. Provides a level of abstraction for building highly scalable applications, without compromising architectural integrity
32 lines (31 loc) • 1.42 kB
TypeScript
import Stack from 'ts-data.stack';
import { TransactionContextHolder } from './TransactonContextHolder';
import { CursorSpecification } from '../cursor/CursorSpecification';
import { QuerySpecification } from '../query/QuerySpecification';
import { Cursor } from '../cursor/Cursor';
import { Connection } from '../connection/Connection';
import { TransactionOptions } from './Transactional';
export declare class Transaction {
readonly contextHolder: TransactionContextHolder;
readonly id: string;
readonly callStack: Stack<string>;
readonly connectionRegistry: Map<string, Connection>;
readonly cursors: Cursor<any>[];
private readonly logger;
private readonly connectionMutex;
private _options;
constructor(options: TransactionOptions, contextHolder: TransactionContextHolder);
get description(): string;
get databases(): string[];
get connections(): Connection[];
query<T>(spec: QuerySpecification<T>, database: string): Promise<T[]>;
openCursor<T>(spec: CursorSpecification<T>, database: string): Promise<Cursor<T>>;
pushContext(context: string | symbol): Promise<void>;
popContext(isRoot: boolean): Promise<void>;
popContextWithError(e: Error, isRoot: boolean): Promise<void>;
markAsRollback(): void;
get options(): TransactionOptions;
set options(options: TransactionOptions);
private connectionFor;
private releaseClient;
}