/**
 * Sybase Drizzle database instance.
 *
 * Provides a Drizzle-like API for Sybase ASE backed by native FreeTDS
 * connections with connection pooling.
 *
 * @example
 * ```ts
 * import { createSybaseDrizzle, sybaseTable, int, varchar } from "drizzle-sybase";
 * import { eq } from "drizzle-orm";
 *
 * const users = sybaseTable("users", {
 *   id: int("id").primaryKey().identity(),
 *   name: varchar("name", { length: 100 }).notNull()
 * });
 *
 * const db = createSybaseDrizzle({
 *   host: "sybase-host",
 *   port: 5000,
 *   database: "mydb",
 *   username: "sa",
 *   password: "secret"
 * });
 *
 * const result = await db.select().from(users).where(eq(users.name, "Alice"));
 * await db.close();
 * ```
 */
import type { SQL } from "drizzle-orm";
import type { SybasePoolConfig, SybasePoolMetrics } from "./connection.js";
import { SybaseSelectBuilder, SybaseInsertBuilder, SybaseUpdateBuilder, SybaseDeleteBuilder } from "./query-builders/index.js";
import type { SybaseTransactionOptions } from "./session.js";
export type SybaseDrizzleConfig = SybasePoolConfig;
export interface SybaseDrizzle {
    /** Start a SELECT query. */
    select(fields?: Record<string, any>): SybaseSelectBuilder;
    /** Start an INSERT query. */
    insert(table: any): SybaseInsertBuilder;
    /** Start an UPDATE query. */
    update(table: any): SybaseUpdateBuilder;
    /** Start a DELETE query. */
    delete(table: any): SybaseDeleteBuilder;
    /** Execute raw SQL using Drizzle's `sql` template tag. */
    execute<T extends Record<string, unknown> = Record<string, unknown>>(query: SQL): Promise<{
        rows: T[];
        rowCount: number;
    }>;
    /** Execute a stored procedure or raw SQL. */
    exec<T extends Record<string, unknown> = Record<string, unknown>>(query: SQL): Promise<{
        rows: T[];
        rowCount: number;
    }>;
    /** Execute a raw SQL string directly. */
    executeRaw<T extends Record<string, unknown> = Record<string, unknown>>(rawSql: string): Promise<{
        rows: T[];
        rowCount: number;
    }>;
    /**
     * Run statements in a real database transaction.
     *
     * @example
     * ```ts
     * await db.transaction(async tx => {
     *   await tx.insert(users).values({ name: "Alice" });
     * }, { isolationLevel: "serializable" });
     * ```
     */
    transaction<T>(fn: (tx: SybaseDrizzleTx) => Promise<T>, options?: SybaseTransactionOptions): Promise<T>;
    /** Close all connections and shut down the pool. */
    close(): Promise<void>;
    /**
     * Gracefully drain the pool — finish all in-flight operations, then close.
     * New operations will be rejected immediately.
     *
     * @param timeoutMs - Maximum time to wait for drain. Default: 30000ms
     */
    drain(timeoutMs?: number): Promise<void>;
    /** Connection pool stats. */
    readonly pool: {
        /** Total connections in pool. */
        readonly size: number;
        /** Active (in-use) connections. */
        readonly active: number;
        /** Idle (available) connections. */
        readonly idle: number;
        /** Requests waiting for a connection. */
        readonly waiting: number;
        /** Whether the pool is draining. */
        readonly isDraining: boolean;
        /** Whether the pool is closed. */
        readonly isClosed: boolean;
        /** Pool metrics snapshot for monitoring. */
        readonly metrics: SybasePoolMetrics;
    };
}
/**
 * Transaction handle — executes on a single held connection.
 */
export interface SybaseDrizzleTx {
    select(fields?: Record<string, any>): SybaseSelectBuilder;
    insert(table: any): SybaseInsertBuilder;
    update(table: any): SybaseUpdateBuilder;
    delete(table: any): SybaseDeleteBuilder;
    execute<T extends Record<string, unknown> = Record<string, unknown>>(query: SQL): Promise<{
        rows: T[];
        rowCount: number;
    }>;
    exec<T extends Record<string, unknown> = Record<string, unknown>>(query: SQL): Promise<{
        rows: T[];
        rowCount: number;
    }>;
    executeRaw<T extends Record<string, unknown> = Record<string, unknown>>(rawSql: string): Promise<{
        rows: T[];
        rowCount: number;
    }>;
}
export declare const createSybaseDrizzle: (config: SybaseDrizzleConfig) => SybaseDrizzle;
//# sourceMappingURL=db.d.ts.map