/** * Shared SQL Adapter Helpers * * Used by both SqlAdapter and SqlTransactionAdapter. * Extracted from sql-adapter.ts — pure code movement. */ import type { LookupOptions, SqlDialect, UpdateOperators } from '../types.js'; export type ExecFn = (sqlStr: string, params?: unknown[]) => Promise<{ rows: unknown[]; rowCount: number; }>; export interface TxClient { query(sql: string, params?: unknown[]): Promise<{ rows: unknown[]; rowCount: number; }>; } /** Limit an UPDATE to a single row, dialect-aware. */ export declare function limitUpdateOne(baseSql: string, collection: string, whereClause: string, dialect: SqlDialect): string; /** Limit a DELETE to a single row, dialect-aware. */ export declare function limitDeleteOne(baseSql: string, collection: string, whereClause: string, dialect: SqlDialect): string; /** Perform upsert: UPDATE then INSERT if no rows matched. */ export declare function performUpsert(execFn: ExecFn, collection: string, filter: Record, update: UpdateOperators>, dialect: SqlDialect): Promise<{ rowCount: number; inserted: boolean; }>; /** Strip excluded fields from result rows. */ export declare function stripExcludedFields(rows: T[], projection?: Record): T[]; /** Two-query lookup: query main table, then related table, nest results. */ export declare function performLookup(execFn: ExecFn, collection: string, options: LookupOptions, dialect: SqlDialect): Promise; //# sourceMappingURL=sql-helpers.d.ts.map