import { CasingCache } from '../casing.js'; import { entityKind } from '../entity.js'; import { PgColumn } from './columns/index.js'; import type { PgDeleteConfig, PgInsertConfig, PgUpdateConfig } from './query-builders/index.js'; import type { PgSelectConfig } from './query-builders/select.types.js'; import { PgTable } from './table.js'; import { type BuildRelationalQueryResult, type DBQueryConfig, type Relation, type TableRelationalConfig, type TablesRelationalConfig } from '../relations.js'; import { type DriverValueEncoder, type QueryTypingsValue, type QueryWithTypings, SQL } from '../sql/sql.js'; import { type Casing, type UpdateSet } from '../utils.js'; import type { PgMaterializedView } from './view.js'; export interface PgDialectConfig { casing?: Casing | undefined; } export declare class PgDialect { static readonly [entityKind]: string; /** @internal */ readonly casing: CasingCache; constructor(config?: PgDialectConfig); escapeName(name: string): string; escapeParam(num: number): string; escapeString(str: string): string; private buildWithCTE; buildDeleteQuery({ table, where, returning, withList }: PgDeleteConfig): SQL; buildUpdateSet(table: PgTable, set: UpdateSet): SQL; buildUpdateQuery({ table, set, where, returning, withList, from, joins }: PgUpdateConfig): SQL; /** * Builds selection SQL with provided fields/expressions * * Examples: * * `select from` * * `insert ... returning ` * * If `isSingleTable` is true, then columns won't be prefixed with table name */ private buildSelection; private buildJoins; private buildFromTable; buildSelectQuery({ withList, fields, fieldsFlat, where, having, table, joins, orderBy, groupBy, limit, offset, lockingClause, distinct, setOperators, }: PgSelectConfig): SQL; buildSetOperations(leftSelect: SQL, setOperators: PgSelectConfig['setOperators']): SQL; buildSetOperationQuery({ leftSelect, setOperator: { type, isAll, rightSelect, limit, orderBy, offset }, }: { leftSelect: SQL; setOperator: PgSelectConfig['setOperators'][number]; }): SQL; buildInsertQuery({ table, values: valuesOrSelect, onConflict, returning, withList, select, overridingSystemValue_ }: PgInsertConfig): SQL; buildRefreshMaterializedViewQuery({ view, concurrently, withNoData }: { view: PgMaterializedView; concurrently?: boolean; withNoData?: boolean; }): SQL; prepareTyping(encoder: DriverValueEncoder): QueryTypingsValue; sqlToQuery(sql: SQL, invokeSource?: 'indexes' | undefined): QueryWithTypings; buildRelationalQueryWithoutPK({ fullSchema, schema, tableNamesMap, table, tableConfig, queryConfig: config, tableAlias, nestedQueryRelation, joinOn, }: { fullSchema: Record; schema: TablesRelationalConfig; tableNamesMap: Record; table: PgTable; tableConfig: TableRelationalConfig; queryConfig: true | DBQueryConfig<'many', true>; tableAlias: string; nestedQueryRelation?: Relation | undefined; joinOn?: SQL | undefined; }): BuildRelationalQueryResult; } //# sourceMappingURL=dialect.d.ts.map