/** Which row image an inline OUTPUT clause reads (mssql): writes → INSERTED, deletes → DELETED. */ export type ReturningSource = 'inserted' | 'deleted'; /** A compiled row-returning clause and where the builder must splice it. */ export interface ReturningClause { sql: string; /** 'suffix' → appended to the statement (RETURNING); 'inline' → before VALUES/WHERE (OUTPUT). */ placement: 'inline' | 'suffix'; } /** * Strategy for rendering SQL that differs between engines: placeholder style, * identifier quoting, pagination, and row-returning writes. One implementation * per supported engine. */ export interface Dialect { /** Render the i-th positional placeholder (1-based). */ placeholder(index: number): string; /** Quote a table/column identifier safely. */ quoteIdentifier(name: string): string; /** Render the pagination clause (leading space included), engine-correct. */ compilePagination(limit?: number, offset?: number): string; /** * Render the clause that makes a write return rows (RETURNING / OUTPUT). * Empty `columns` means all columns. Throws UnsupportedEngineException * where the engine has no equivalent (mysql, oracle). */ compileReturning(columns: string[], source: ReturningSource): ReturningClause; } export declare class PostgresDialect implements Dialect { placeholder(index: number): string; quoteIdentifier(name: string): string; compilePagination(limit?: number, offset?: number): string; compileReturning(columns: string[]): ReturningClause; } export declare class MySqlDialect implements Dialect { placeholder(_index: number): string; quoteIdentifier(name: string): string; compilePagination(limit?: number, offset?: number): string; compileReturning(): ReturningClause; } export declare class SqliteDialect implements Dialect { placeholder(_index: number): string; quoteIdentifier(name: string): string; compilePagination(limit?: number, offset?: number): string; compileReturning(columns: string[]): ReturningClause; } export declare class MssqlDialect implements Dialect { placeholder(index: number): string; quoteIdentifier(name: string): string; compilePagination(limit?: number, offset?: number): string; compileReturning(columns: string[], source: ReturningSource): ReturningClause; } export declare class OracleDialect implements Dialect { placeholder(index: number): string; quoteIdentifier(name: string): string; compilePagination(limit?: number, offset?: number): string; compileReturning(): ReturningClause; }