import type { Client, RequestOptions } from "./client.js"; import type { ResultFormat, StatementCancelResult, StatementEstimatedProgress, StatementStatus } from "./protocol.js"; import type { Value } from "./result.js"; import { ResultSet } from "./result.js"; export interface WaitOptions extends RequestOptions { /** * Initial polling delay in milliseconds. * The delay doubles on each poll up to `maxDelayMs`. * @default 5 */ initialDelayMs?: number; /** * Maximum polling delay in milliseconds. * @default 1000 */ maxDelayMs?: number; } /** @deprecated Use `WaitOptions`. */ export type FetchOptions = WaitOptions; export declare class Statement { private readonly client; private readonly statementText; private statementIdValue?; private execTimeoutValue?; private maxParallelismValue?; private readonly format; constructor(client: Client, statementText: string); withStatementId(statementId: string): this; withExecTimeout(execTimeout: string): this; withMaxParallelism(maxParallelism: number): this; submit(options?: RequestOptions): Promise; execute(options?: WaitOptions): Promise; /** * Executes the statement and returns the first row as a plain object, or * `null` if the result set is empty. * * Useful for point lookups and aggregate queries that return at most one row. * * @example * const row = await client.statement("FROM events AGGREGATE count() AS n").executeOne(); * console.log(row?.["n"]); // bigint * * @deprecated Use `execute()` followed by `ResultSet.first()`. */ executeOne(options?: WaitOptions): Promise | null>; } export declare class StatementHandle { private readonly client; readonly statementId: string; private readonly format; private currentStatus?; constructor(client: Client, statementId: string, format?: ResultFormat, currentStatus?: StatementStatus | undefined); /** Returns the latest status snapshot held by this handle without making a request. */ lastStatus(): StatementStatus | undefined; progress(): StatementEstimatedProgress | undefined; resultSet(): ResultSet | null; /** Fetches and returns the latest status, or reuses a cached terminal status. */ status(options?: RequestOptions): Promise; /** @deprecated Use `status()`. */ fetchOnce(options?: RequestOptions): Promise; /** Waits for the statement to terminate and returns its result set. */ wait(options?: WaitOptions): Promise; /** @deprecated Use `wait()`. */ fetch(options?: WaitOptions): Promise; cancel(options?: RequestOptions): Promise; } //# sourceMappingURL=statement.d.ts.map