Ducklings API Documentation
    Preparing search index...
    • 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.

      Parameters

      • sql: string

        The SQL statement to check

      • options: SanitizeSqlOptions = {}

        Options to selectively allow certain patterns

      Returns SanitizeResult

      A SanitizeResult object with safety status

      const result = checkSql("SELECT * FROM duckdb_secrets()");
      if (!result.safe) {
      console.log(`Blocked: ${result.reason}`);
      }