import type { Client, PoolClient, QueryResult, QueryResultRow } from 'pg';
import pg from 'pg';
import type { CockroachDialect } from "../cockroach-core/dialect.js";
import { CockroachTransaction } from "../cockroach-core/index.js";
import type { SelectedFieldsOrdered } from "../cockroach-core/query-builders/select.types.js";
import type { CockroachQueryResultHKT, CockroachTransactionConfig, PreparedQueryConfig } from "../cockroach-core/session.js";
import { CockroachPreparedQuery, CockroachSession } from "../cockroach-core/session.js";
import { entityKind } from "../entity.js";
import { type Logger } from "../logger.js";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";
import { type Query, type SQL } from "../sql/sql.js";
import { type Assume } from "../utils.js";
export type NodeCockroachClient = pg.Pool | PoolClient | Client;
export declare class NodeCockroachPreparedQuery<T extends PreparedQueryConfig> extends CockroachPreparedQuery<T> {
    private client;
    private params;
    private logger;
    private fields;
    private _isResponseInArrayMode;
    private customResultMapper?;
    static readonly [entityKind]: string;
    private rawQueryConfig;
    private queryConfig;
    constructor(client: NodeCockroachClient, queryString: string, params: unknown[], logger: Logger, fields: SelectedFieldsOrdered | undefined, name: string | undefined, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined);
    execute(placeholderValues?: Record<string, unknown> | undefined): Promise<T['execute']>;
    all(placeholderValues?: Record<string, unknown> | undefined): Promise<T['all']>;
}
export interface NodeCockroachSessionOptions {
    logger?: Logger;
}
export declare class NodeCockroachSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends CockroachSession<NodeCockroachQueryResultHKT, TFullSchema, TSchema> {
    private client;
    private schema;
    private options;
    static readonly [entityKind]: string;
    private logger;
    constructor(client: NodeCockroachClient, dialect: CockroachDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: NodeCockroachSessionOptions);
    prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query, fields: SelectedFieldsOrdered | undefined, name: string | undefined, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => T['execute']): CockroachPreparedQuery<T>;
    transaction<T>(transaction: (tx: NodeCockroachTransaction<TFullSchema, TSchema>) => Promise<T>, config?: CockroachTransactionConfig | undefined): Promise<T>;
    count(sql: SQL): Promise<number>;
}
export declare class NodeCockroachTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends CockroachTransaction<NodeCockroachQueryResultHKT, TFullSchema, TSchema> {
    static readonly [entityKind]: string;
    transaction<T>(transaction: (tx: NodeCockroachTransaction<TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export interface NodeCockroachQueryResultHKT extends CockroachQueryResultHKT {
    type: QueryResult<Assume<this['row'], QueryResultRow>>;
}
