import type { TableSchema } from '../schema/table-builder'; /** * Column configuration extracted from schema */ export interface ColumnConfig { propName: string; dbName: string; mapper?: { toDriver: (value: any) => any; fromDriver: (value: any) => any; }; primaryKey?: boolean; autoIncrement?: boolean; } /** * Result from building VALUES clause */ export interface ValuesClauseResult { valueClauses: string[]; params: any[]; nextParamIndex: number; } /** * Get qualified table name with schema prefix if specified */ export declare function getQualifiedTableName(schema: TableSchema): string; /** * Build RETURNING column list from schema */ export declare function buildReturningColumnList(schema: TableSchema): string; /** * Build column names list from property keys */ export declare function buildColumnNamesList(schema: TableSchema, columnKeys: string[]): string[]; /** * Apply mapper and get value for database */ export declare function applyToDriverMapper(value: any, config: ColumnConfig): any; /** * Apply fromDriver mapper on query result */ export declare function applyFromDriverMapper(value: any, config: ColumnConfig): any; /** * Detect primary keys from schema */ export declare function detectPrimaryKeys(schema: TableSchema): string[]; /** * Check if schema has auto-increment primary key with provided data */ export declare function hasAutoIncrementPrimaryKey(schema: TableSchema, dataKeys: string[]): boolean; /** * PostgreSQL maximum parameter limit */ export declare const POSTGRES_MAX_PARAMS = 65535; /** * Calculate optimal chunk size for bulk operations */ export declare function calculateOptimalChunkSize(columnCount: number, configChunkSize?: number): number; /** * Build column configs from schema for given data keys */ export declare function buildColumnConfigs(schema: TableSchema, dataKeys: string[], includeAutoIncrement?: boolean): ColumnConfig[]; /** * Extract unique column keys from array of data objects * A column is included if ANY row has a non-undefined value for it. * Columns with defaults are only skipped if ALL rows have undefined for that column. */ export declare function extractUniqueColumnKeys(dataArray: Record[], schema: TableSchema, includeAutoIncrement?: boolean): string[]; /** * Build VALUES clause with parameter placeholders */ export declare function buildValuesClause(dataArray: Record[], columnConfigs: ColumnConfig[], startParamIndex?: number): ValuesClauseResult; /** * Build ON CONFLICT clause for upserts */ export declare function buildConflictClause(conflictColumns: string[], updateColumns: string[], schema: TableSchema, targetWhere?: string, setWhere?: string): string; /** * Build column name to DB name mapping */ export declare function buildColumnNameMap(schema: TableSchema): Map; /** * Get database column name from property name */ export declare function getDbColumnName(schema: TableSchema, propName: string): string; //# sourceMappingURL=sql-utils.d.ts.map