/** * Quotes identifiers — table, column and alias names — the way one dialect spells them. * * Resolved from the DRIVER's container like every other compiler and statement, so a * driver picks its quoting the same way it picks its SQL. This used to be a module-level * function in `@spinajs/orm-sql` that emitted backticks and was imported directly by * nearly every shared statement and compiler — including MSSQL's own, which therefore * produced `` `table` `` where SQL Server needs `[table]`. Shadowing a compiler cannot * shadow a function it calls internally, so quoting had to become a service before the * "each driver registers its own dialect" rule could hold for identifiers at all. * * There is deliberately NO default registration. Backticks are MySQL and SQLite; * brackets are MSSQL; the ANSI double quote is rejected by MySQL unless `ANSI_QUOTES` is * on. Nothing is portable here, so nothing is inherited: a driver that registers no * quoter fails loudly on its first query instead of emitting another dialect's SQL. */ export declare abstract class IdentifierQuoter { /** * Quotes one identifier, escaping the quote character if the name contains it. */ abstract quote(name: string): string; /** * Quotes a possibly schema-qualified name, quoting each dot-separated part on its own: * `schema.table` becomes `` `schema`.`table` ``, never `` `schema.table` `` — the latter * is a single identifier and every one of these databases rejects it as a table * reference. * * A table whose name genuinely contains a dot cannot be expressed through the APIs that * take a qualified name as one string; it never could. */ quoteQualified(name: string): string; } /** * Writes a VALUE into SQL text the way one dialect spells literals. * * Only for statements the engine stores as text and therefore cannot bind into - * CREATE VIEW and CREATE EVENT. Every other statement keeps binding its values. * No default registration, for the same reason {@link IdentifierQuoter} has none. */ export declare abstract class LiteralQuoter { abstract quote(value: unknown): string; } //# sourceMappingURL=quoting.d.ts.map