/**
 * DbPort — re-export of the existing minimal DbClient shape from
 * tracking/agent-run-tracker. Alias DbPort is the port-suffixed name
 * used across other ports; DbClient remains exported for back-compat.
 *
 * OTel instrumentation: import { createTracedDbPort } to wrap any
 * DbPort implementation with OpenTelemetry spans per query.
 * Gracefully degrades to noop spans when no OTel SDK is installed.
 */
import type { DbClient } from "../tracking/agent-run-tracker.js";
export type { DbClient as DbPort } from "../tracking/agent-run-tracker.js";
export type { DbClient } from "../tracking/agent-run-tracker.js";
/**
 * Thrown when the database connection is lost (ECONNREFUSED, pool exhausted,
 * or TLS handshake failed). Callers should retry with exponential backoff
 * once the connection pool is re-established.
 */
export declare class DbConnectionLostError extends Error {
    readonly cause?: unknown | undefined;
    constructor(message: string, cause?: unknown | undefined);
}
/**
 * Thrown when a database query exceeds the configured statement_timeout or
 * the caller-supplied timeoutMs. The query may have been cancelled by the
 * server — retrying the same query without changes is unlikely to succeed.
 */
export declare class DbQueryTimeoutError extends Error {
    readonly cause?: unknown | undefined;
    /** The SQL statement that timed out (truncated for logging). */
    readonly queryPreview: string;
    /** Timeout that was exceeded, in milliseconds. */
    readonly timeoutMs: number;
    constructor(message: string, queryPreview: string, timeoutMs: number, cause?: unknown | undefined);
}
/**
 * Wrap any DbPort implementation with OTel spans per query() call.
 * The span captures the SQL preview (first 200 chars) and params count.
 * Gracefully degrades to noop spans when no OTel SDK is installed.
 *
 * Usage:
 *   const raw: DbPort = pgPool;
 *   const traced = createTracedDbPort(raw);
 *   const { rows } = await traced.query("SELECT ...") // emits "db.query" span
 */
export declare function createTracedDbPort(impl: DbClient): DbClient;
//# sourceMappingURL=db.d.ts.map