/**
 * Sybase session — wraps connection pool to provide query execution.
 *
 * Transactions hold a single connection for the entire duration,
 * with proper BEGIN/COMMIT/ROLLBACK semantics.
 * Supports transaction isolation levels.
 */
import type { SybaseConnection, SybasePool, QueryResult, SybaseLogger } from "./connection.js";
/**
 * Sybase ASE transaction isolation levels.
 *
 * - `read_uncommitted` (level 0): Allows dirty reads
 * - `read_committed` (level 1): Default. Only reads committed data
 * - `repeatable_read` (level 2): Prevents non-repeatable reads
 * - `serializable` (level 3): Full isolation
 */
export type SybaseIsolationLevel = "read_uncommitted" | "read_committed" | "repeatable_read" | "serializable";
/**
 * Options for configuring a transaction.
 */
export interface SybaseTransactionOptions {
    /** Transaction isolation level. Default: uses server default (read_committed). */
    isolationLevel?: SybaseIsolationLevel;
}
export interface SybaseSessionQueryResult<T = Record<string, unknown>> {
    rows: T[];
    rowCount: number;
    affectedRows: number;
}
export declare class SybaseSession {
    private readonly pool;
    constructor(pool: SybasePool);
    /**
     * Execute raw SQL and return results.
     */
    execute<T extends Record<string, unknown> = Record<string, unknown>>(rawSql: string, options?: {
        maxRows?: number;
    }): Promise<SybaseSessionQueryResult<T>>;
    /**
     * Execute raw SQL and return the full result (including columns).
     */
    executeRaw(rawSql: string, options?: {
        maxRows?: number;
    }): Promise<QueryResult>;
    /**
     * Run a transaction on a single connection.
     *
     * Acquires a connection, optionally sets isolation level, executes BEGIN TRAN,
     * runs the callback, then COMMIT or ROLLBACK. The connection is held for the duration.
     *
     * @example
     * ```ts
     * await session.transaction(async tx => {
     *   await tx.execute("INSERT INTO ...");
     * }, { isolationLevel: "serializable" });
     * ```
     */
    transaction<T>(fn: (tx: SybaseTransactionSession) => Promise<T>, options?: SybaseTransactionOptions): Promise<T>;
}
export declare class SybaseTransactionSession {
    private readonly conn;
    private readonly logger?;
    constructor(conn: SybaseConnection, logger?: SybaseLogger | undefined);
    /**
     * Execute raw SQL within the transaction.
     */
    execute<T extends Record<string, unknown> = Record<string, unknown>>(rawSql: string, options?: {
        maxRows?: number;
    }): Promise<SybaseSessionQueryResult<T>>;
    executeRaw(rawSql: string, options?: {
        maxRows?: number;
    }): Promise<QueryResult>;
    private runWithLogging;
}
//# sourceMappingURL=session.d.ts.map