import type { Database } from './specs/Database.nitro'; import type { QueryResult } from './specs/QueryResult.nitro'; import type { PreparedStatement } from './specs/PreparedStatement.nitro'; import type { DuckDBValue, BatchCommand, BatchResult, AttachOptions, CloseOptions, ConnectionInfo } from './types'; export type TransactionInfo = { statementsExecuted: number; rolledBack: boolean; depth: number; }; export type TransactionContext = { executeSync(sql: string, params?: DuckDBValue[]): QueryResult; execute(sql: string, params?: DuckDBValue[]): Promise; prepare(sql: string): PreparedStatement; transaction(callback: (tx: TransactionContext) => Promise): Promise; }; export interface WrappedDatabase { readonly isOpen: boolean; close(options?: CloseOptions): void; executeSync(sql: string, params?: DuckDBValue[]): QueryResult; execute(sql: string, params?: DuckDBValue[]): Promise; prepare(sql: string): PreparedStatement; connect(): WrappedDatabase; connections(): ConnectionInfo; closeConnections(): void; attach(path: string, alias: string, options?: AttachOptions): void; detach(alias: string): void; executeBatchSync(commands: BatchCommand[]): BatchResult; executeBatch(commands: BatchCommand[]): Promise; transaction(callback: (tx: TransactionContext) => Promise): Promise; } export declare function executeTransaction(db: Database, callback: (tx: TransactionContext) => Promise): Promise; export declare function createWrappedDatabase(db: Database): WrappedDatabase; //# sourceMappingURL=transaction.d.ts.map