Checks if a SQL statement contains dangerous patterns.
This function does not throw - it returns a result object indicating whether the SQL is safe or not. Use this when you want to handle unsafe SQL yourself.
The SQL statement to check
Options to selectively allow certain patterns
A SanitizeResult object with safety status
const result = checkSql("SELECT * FROM duckdb_secrets()");if (!result.safe) { console.log(`Blocked: ${result.reason}`);} Copy
const result = checkSql("SELECT * FROM duckdb_secrets()");if (!result.safe) { console.log(`Blocked: ${result.reason}`);}
Checks if a SQL statement contains dangerous patterns.
This function does not throw - it returns a result object indicating whether the SQL is safe or not. Use this when you want to handle unsafe SQL yourself.