UNPKG

@clickup/ent-framework

Version:

A PostgreSQL graph-database-alike library with microsharding and row-level security

40 lines 1.7 kB
import type { QueryAnnotation } from "../abstract/QueryAnnotation"; import { QueryBase } from "../abstract/QueryBase"; import type { Schema } from "../abstract/Schema"; import type { Hints, Literal, Row, SelectInput, Table } from "../types"; import type { PgClient } from "./PgClient"; import { PgRunner } from "./PgRunner"; /** * This is mostly to do hacks in PostgreSQL queries. Not even exposed by Ent * framework, but can be used by PG-dependent code. */ export type SelectInputCustom = { ctes?: Literal[]; joins?: Literal[]; from?: Literal; hints?: Hints; } | undefined; export declare class PgQuerySelect<TTable extends Table> extends QueryBase<TTable, SelectInput<TTable>, Array<Row<TTable>>, PgClient> { /** @ignore */ readonly RUNNER_CLASS: typeof PgRunnerSelect; run(client: PgClient, annotation: QueryAnnotation): Promise<Array<Row<TTable>>>; } declare class PgRunnerSelect<TTable extends Table> extends PgRunner<TTable, SelectInput<TTable>, Array<Row<TTable>>> { static readonly IS_WRITE = false; private prefix; private prefixUnion; private midfixUnion; private builder; readonly op = "SELECT"; readonly maxBatchSize = 10; readonly default: never[]; constructor(schema: Schema<TTable>, client: PgClient); key(input: SelectInput<TTable>): string; runSingle(input: SelectInput<TTable>, annotations: QueryAnnotation[]): Promise<Array<Row<TTable>>>; runBatch(inputs: Map<string, SelectInput<TTable>>, annotations: QueryAnnotation[]): Promise<Map<string, Array<Row<TTable>>>>; private buildCustom; private buildOptionalOrder; private buildLimit; } export {}; //# sourceMappingURL=PgQuerySelect.d.ts.map