import type { Dialect } from '../drivers/Driver'; export type WhereOp = '=' | '!=' | '<' | '<=' | '>' | '>=' | 'LIKE' | 'IN' | 'IS NULL' | 'IS NOT NULL'; export interface WhereClause { column: string; op: WhereOp; value?: unknown; } /** Filter syntax accepted by AbstractDao.find. */ export type Filter = Record | WhereClause[]; export interface BuiltSql { sql: string; params: unknown[]; } /** * Case convention for filter keys passed to `find()` / `count()`. * - `'snake'` (default): keys must match the actual column names exactly. * - `'camel'`: camelCase keys are translated to snake_case before SQL, * so `dao.find({ roomId: 1 })` resolves to `WHERE "room_id" = $1`. */ export type FilterCaseConvention = 'snake' | 'camel'; export interface QueryBuilderOptions { filterCase?: FilterCaseConvention; } export declare class QueryBuilder { private readonly dialect; private readonly filterCase; constructor(dialect: Dialect, opts?: QueryBuilderOptions); /** Map a filter-side key to a column name, honoring the configured case convention. */ private columnFor; select(table: string, schema: string, filter?: Filter, opts?: { orderBy?: string; limit?: number; offset?: number; }): BuiltSql; count(table: string, schema: string, filter?: Filter): BuiltSql; insert(table: string, schema: string, row: Record, returning?: readonly string[]): BuiltSql; update(table: string, schema: string, diff: Record, pk: Record): BuiltSql; delete(table: string, schema: string, pk: Record): BuiltSql; qualified(schema: string, table: string): string; private where; private renderClause; }