import { PgDialect } from "../dialect.cjs";
import { PgBasePreparedQuery, PgQueryResultHKT, PgSession, PgTransactionConfig, PreparedQueryConfig } from "../session.cjs";
import { PgAsyncDatabase } from "./db.cjs";
import { entityKind } from "../../entity.cjs";
import { Query, SQL } from "../../sql/sql.cjs";
import { Logger } from "../../logger.cjs";
import { MigrationConfig, MigrationMeta, MigratorInitFailResponse } from "../../migrator.cjs";
import { AnyRelations, EmptyRelations } from "../../relations.cjs";
import { WithCacheConfig } from "../../cache/core/types.cjs";
import { Cache } from "../../cache/core/cache.cjs";

//#region src/pg-core/async/session.d.ts
declare class PgAsyncPreparedQuery<T extends PreparedQueryConfig> extends PgBasePreparedQuery {
  protected executor: (params?: unknown[]) => Promise<any>;
  readonly mode: 'arrays' | 'objects' | 'raw';
  protected logger: Logger;
  protected cache: Cache | undefined;
  protected queryMetadata: {
    type: 'select' | 'update' | 'delete' | 'insert';
    tables: string[];
  } | undefined;
  protected cacheConfig: WithCacheConfig | undefined;
  static readonly [entityKind]: string;
  private fastPath;
  constructor(executor: (params?: unknown[]) => Promise<any>, query: Query, mapper: ((rows: any[]) => any) | undefined, mode: 'arrays' | 'objects' | 'raw', logger: Logger, cache: Cache | undefined, queryMetadata: {
    type: 'select' | 'update' | 'delete' | 'insert';
    tables: string[];
  } | undefined, cacheConfig: WithCacheConfig | undefined);
  execute(placeholderValues?: Record<string, unknown>): Promise<T['execute']>;
}
declare abstract class PgAsyncSession<TQueryResult extends PgQueryResultHKT = PgQueryResultHKT, TRelations extends AnyRelations = EmptyRelations> extends PgSession {
  static readonly [entityKind]: string;
  abstract prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query, mode: 'arrays' | 'objects' | 'raw', name: string | boolean, mapper?: (rows: any[]) => any, queryMetadata?: {
    type: 'select' | 'update' | 'delete' | 'insert';
    tables: string[];
  }, cacheConfig?: WithCacheConfig, driverShape?: unknown): PgAsyncPreparedQuery<T>;
  execute<T>(query: SQL): Promise<T[]>;
  arrays<T>(query: SQL): Promise<T[]>;
  objects<T>(query: SQL): Promise<T[]>;
  abstract transaction<T>(transaction: (tx: PgAsyncTransaction<TQueryResult, TRelations>) => Promise<T>, config?: PgTransactionConfig): Promise<T>;
}
declare abstract class PgAsyncTransaction<TQueryResult extends PgQueryResultHKT, TRelations extends AnyRelations = EmptyRelations> extends PgAsyncDatabase<TQueryResult, TRelations> {
  protected readonly nestedIndex: number;
  static readonly [entityKind]: string;
  constructor(dialect: PgDialect, session: PgAsyncSession<any, any>, relations: TRelations, nestedIndex: number | undefined, parseRqbJson: boolean | undefined);
  rollback(): never;
  setTransaction(config: PgTransactionConfig): Promise<unknown>;
  abstract transaction<T>(transaction: (tx: PgAsyncTransaction<TQueryResult, TRelations>) => Promise<T>): Promise<T>;
}
declare function migrate(migrations: MigrationMeta[], db: PgAsyncDatabase<PgQueryResultHKT, any>, config: string | MigrationConfig): Promise<void | MigratorInitFailResponse>;
//#endregion
export { PgAsyncPreparedQuery, PgAsyncSession, PgAsyncTransaction, migrate };
//# sourceMappingURL=session.d.cts.map