import type { OrderDir, QueryExecutor, WhereCondition } from "../core/query.js"; import type { SQLChunk } from "../core/sql.js"; import { type Table } from "../schema/table.js"; import type { ColumnConfig, InferColumnType, InferTable } from "../types/index.js"; import type { CTEBuilder } from "./cte.js"; export type SelectedFields = { [key: string]: ColumnConfig | SQLChunk | SelectedFields; }; export type InferSelection = { [K in keyof T]: T[K] extends ColumnConfig ? InferColumnType : T[K] extends SQLChunk ? U : T[K] extends SelectedFields ? InferSelection : never; }; export declare class SelectBuilder, TResult = InferTable> implements PromiseLike { private _table; private _executor; private _where; private _orderBy; private _groupBy; private _having; private _limit?; private _offset?; private _select?; private _selection?; private _joins; private _isNestedOutput; private _with; private _setOperations; private _comment?; constructor(table: Table | CTEBuilder, executor: QueryExecutor, selection?: SelectedFields); then(onfulfilled?: ((value: TResult[]) => TResult1 | PromiseLike) | undefined, onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | undefined): Promise; single(): Promise; select(...columns: ((keyof TColumns & string) | ColumnConfig)[]): this; with(...ctes: CTEBuilder[]): this; union(other: { toSQL(): SQLChunk; }): this; unionAll(other: { toSQL(): SQLChunk; }): this; intersect(other: { toSQL(): SQLChunk; }): this; except(other: { toSQL(): SQLChunk; }): this; comment(tag: string): this; where(condition: WhereCondition): this; orderBy(column: (keyof TColumns & string) | (string & {}) | ColumnConfig | SQLChunk, dir?: OrderDir): this; groupBy(...columns: ((keyof TColumns & string) | (string & {}) | ColumnConfig | SQLChunk)[]): this; having(condition: WhereCondition): this; limit(n: number): this; offset(n: number): this; paginate(page: number, pageSize: number): this; cursorPaginate(cursor: string | number | Date | null | undefined, limit: number, cursorColumn?: (keyof TColumns & string) | ColumnConfig): this; as(aliasName: TAlias): Table>>; join(rawClause: string): this; private _buildJoin; innerJoin(table: Table | CTEBuilder, condition: SQLChunk): this; leftJoin(table: Table | CTEBuilder, condition: SQLChunk): this; rightJoin(table: Table | CTEBuilder, condition: SQLChunk): this; fullJoin(table: Table | CTEBuilder, condition: SQLChunk): this; private _buildSelection; toSQL(): SQLChunk; } export declare class SelectBuilderIntermediate { private _executor; private _selection?; constructor(_executor: QueryExecutor, _selection?: TSelection | undefined); from>>(table: Table | CTEBuilder): SelectBuilder : InferTable>; } //# sourceMappingURL=select.d.ts.map