import { ContractCountArgs, ContractFindManyArgs, ContractFindUniqueArgs, ContractGroupByArgs, JsonProjectionResult } from "../model-types.js"; import { ContractCacheArgs, ContractCacheInspection, ContractCacheResult, QueryClient } from "../query-client.js"; import { QuerySource } from "../query-source.js"; import { PqsSchemaProfileV1 } from "./pqs-schema-profile.js"; export interface PqsQueryExecutor { query(text: string, values: readonly unknown[]): Promise<{ readonly rows: readonly Record[]; }>; } export declare class PqsQueryClient implements QueryClient { private readonly executor; private readonly profile; readonly source = QuerySource.pqs; readonly contracts: { findMany: (args?: TArgs) => Promise)[]>; findUnique: (args: TArgs) => Promise<(import("../model-types.js").ContractRow & import("../model-types.js").ContractRelationRow & JsonProjectionResult) | undefined>; count: (args?: ContractCountArgs) => Promise; aggregate: (args: Parameters[0]) => Promise<{ readonly count?: number; readonly min?: Readonly>>; readonly max?: Readonly>>; readonly sum?: Readonly>>; }>; groupBy: (args: ContractGroupByArgs) => Promise>[]>; }; readonly contractTypes: QueryClient["contractTypes"]; readonly events: QueryClient["events"]; readonly exercises: QueryClient["exercises"]; readonly exerciseTypes: QueryClient["exerciseTypes"]; readonly packages: QueryClient["packages"]; readonly transactions: QueryClient["transactions"]; readonly watermark: QueryClient["watermark"]; private readonly checkReadyAsync; private readyPromise?; constructor(executor: PqsQueryExecutor, profile: PqsSchemaProfileV1, readiness?: Promise | (() => Promise)); /** * Awaits the readiness check, memoizing success so validation runs once, * but clearing the memo on rejection so a transiently unreachable PQS is * revalidated on the next query instead of pinning the first failure. */ private ready; $queryRaw(sql: string, values?: readonly unknown[]): Promise; cacheContracts(_args?: ContractCacheArgs): Promise; invalidateContractsCache(_args?: ContractCacheArgs): Promise; inspectContractsCache(_args?: ContractCacheArgs): Promise; private createPhysicalDelegate; private readPhysicalAsync; private countPhysicalAsync; private aggregatePhysicalAsync; private groupPhysicalAsync; private mapPhysicalRow; private mapIncludedPhysicalValue; private findContractsAsync; private countContractsAsync; private aggregateContractsAsync; private groupContractsAsync; private wrap; }