import { C as Connection, U as UnexpectedErrorEvent, T as Trace, b as Driver, c as DriverStartOptions } from '../shared/hive.DlaRxYsk.js'; import { RowObject, RowValues, Transaction, TransactionResult, Statement } from '../sdk/transaction.js'; import { Logger } from '../sdk/logger.js'; import { ByteStream } from '../streams/index.js'; import 'zod'; declare class NodeDatabaseConnection extends Connection { /** * Internal `DatabaseSync` (from `node:sqlite`) instance, facilitating * native SQLite function bindings. */ private db; /** * Path on the source database file on disk. If the contents were provided * in-memory, this will be a temporary file. */ private readonly path; /** * Whether the database file is temporary and should be deleted on close. * This is true when the database was created from in-memory contents. */ private readonly isTemporary; /** * Path to the temporary directory for storing temporary files. */ private readonly tmpDir; /** * Logger instance to use for logging. */ private logger; /** * Error handler to invoke with any errors which might occur during * background tasks. */ private onError; constructor(contents: Uint8Array | string, opts: { tmpDir: string; logger?: Logger | null | undefined; onError?: ((event: UnexpectedErrorEvent) => void) | null | undefined; }); readonly getSize: () => Promise; readonly getContents: () => Promise; readonly query: = ReadonlyArray>(transaction: Transaction) => Promise>; /** * Close the `NodeDatabaseConnection` instance. * * @returns Promise resolving when the `NodeDatabaseConnection` instance has * been closed. */ readonly close: (_opts?: { trace?: Trace | null | undefined; }) => Promise; } type NodeDriverConfig = { /** * List of Statements to provision a `Binding` instance with. Allows for * configuring SQLite with custom settings. * * @default `SENSIBLE_DEFAULTS` */ provision?: Array | null | undefined; /** * Path to the temporary directory for storing temporary database files. * * @default `.tmp/${crypto.randomUUID()}` */ tmpDir?: string | null | undefined; }; declare class NodeDriver extends Driver { static readonly name = "node-driver"; /** * `Logger` instance to use for logging. */ private logger; /** * Error handler to invoke with any errors which might occur during * background tasks. */ private onError; /** * List of Statements to provision a `Connection` with after opening it. * * Allows for applying custom SQLite default settings like WAL mode or a * custom page size. */ private readonly provision; /** * Path to the temporary directory for storing temporary database files. * * Directory is created lazily when needed and cleaned up on stop if it * was created. */ private tmpDir; constructor(config?: NodeDriverConfig); readonly start: (opts?: DriverStartOptions & { trace?: Trace | null | undefined; }) => Promise; readonly stop: (opts?: { trace?: Trace | null | undefined; }) => Promise; readonly open: (contents: Uint8Array | ":memory:" | string, opts?: { trace?: Trace | null | undefined; }) => Promise; } export { NodeDatabaseConnection, NodeDriver };