/** * Explicit connection facade that tags operation-owned asynchronous work while * forwarding the driver's synchronous SQL-builder and capability APIs. */ export default class VelociousDatabaseOperationConnection { _physicalConnection: import("./drivers/base.js").default; _operation: import("./operation.js").default; _owner: symbol; /** * Runs constructor. * @param {object} args - Connection ownership. * @param {import("./drivers/base.js").default} args.connection - Pinned physical connection. * @param {import("./operation.js").default} args.operation - Owning operation. * @param {symbol} args.owner - Opaque lease owner token. */ constructor({ connection, operation, owner }: { connection: import("./drivers/base.js").default; operation: import("./operation.js").default; owner: symbol; }); /** * Runs a tagged SQL query on the pinned connection. * @param {string} sql - SQL string. * @param {import("./drivers/base.js").QueryOptions} [options] - Query options. * @returns {Promise} - Query result. */ query(sql: string, options?: import("./drivers/base.js").QueryOptions): Promise; /** * Streams an operation-owned SQL query. * @param {string} sql - SQL string. * @param {import("./drivers/base.js").QueryOptions} [options] - Query options. * @yields {Record} - Query rows. */ queryStream(sql: string, options?: import("./drivers/base.js").QueryOptions): AsyncGenerator; /** * Executes an operation-owned mutation and returns its affected row count. * @param {string} sql - Mutation SQL string. * @param {import("./drivers/base.js").QueryOptions} [options] - Query options. * @returns {Promise} - Affected row count. */ affectedRows(sql: string, options?: import("./drivers/base.js").QueryOptions): Promise; /** * Runs an operation-owned transaction or nested savepoint. * @template T * @param {() => Promise} callback - Transaction callback. * @returns {Promise} - Callback result. */ transaction(callback: () => Promise): Promise; /** * Registers an operation-owned before-commit guard. * @param {() => void | Promise} callback - Guard callback. * @returns {Promise} - Resolves after registration. */ beforeCommit(callback: () => void | Promise): Promise; /** * Registers an operation-owned after-commit callback. * @param {() => void | Promise} callback - Callback. * @returns {Promise} - Resolves after registration or execution. */ afterCommit(callback: () => void | Promise): Promise; /** * Returns the last inserted identifier through the operation lease. * @returns {Promise} - Last inserted identifier. */ lastInsertID(): Promise; } //# sourceMappingURL=operation-connection.d.ts.map