/** * Shared gate rules. Dialect-independent decisions. * A new dialect must not copy these lists — it must call them. */ import type { SqlDialectId } from './types.js'; export declare const WRITE_TOKENS: readonly ['DROP ', 'TRUNCATE ', 'DELETE ', 'UPDATE ', 'INSERT ', 'ALTER ', 'CREATE ', 'GRANT ', 'REVOKE ', 'MERGE ', 'COPY ', 'CALL ', 'DO ', 'VACUUM ']; export declare const SAFE_BUILTIN_FUNCTIONS: Set; /** * Dialect-specific scalar functions. The shared list carries Postgres names; once * the MSSQL and Oracle gates bound to that list, the most ordinary calls like * `GETDATE`/`NVL` started being rejected — the gate closed while legitimate use * broke. * * Rule: only pure, read-oriented scalar transforms that do not change row count * go here. Anything that aggregates/serializes rows is BLOCKED_DUMP_FUNCTIONS' * job; families that produce dynamic SQL or reach file/network/OS (DBMS_*, UTL_*, * xp_*, sp_*, OPENROWSET/OPENJSON) must never be written here. */ export declare const DIALECT_SAFE_FUNCTIONS: Record<'mssql' | 'oracle', ReadonlySet>; export declare const BLOCKED_DUMP_FUNCTIONS: Set; export declare function normalizedSqlHead(sql: string): string; export declare function isSelectOrWith(norm: string): boolean; /** Drop quoted literals so `SELECT 'DELETE ' FROM t` is not a write. */ export declare function stripSqlStringLiterals(sql: string): string; export declare function findWriteToken(norm: string): string | undefined; export declare function hasRowLockClause(norm: string): boolean; export declare function isSafeBuiltinFunction(baseName: string, schema?: string, dialect?: SqlDialectId): boolean; export declare function isBlockedDumpFunction(baseName: string): boolean; /** Same deny text as the Postgres gate — dialects must not invent their own. */ export declare function denyUnsafeFunction(baseName: string, schema?: string, dialect?: SqlDialectId): string | undefined; /** Strip line and block comments without touching quoted strings. */ export declare function stripSqlComments(sql: string): string; //# sourceMappingURL=rules.d.ts.map