{
  "cases": [
    {
      "category": "function",
      "dialect": "bigquery",
      "id": "bigquery-external-query",
      "kind": "attack",
      "sql": "SELECT * FROM external_query('conn', 'SELECT 1')"
    },
    {
      "category": "function",
      "dialect": "bigquery",
      "id": "bigquery-load-data",
      "kind": "attack",
      "sql": "SELECT load_data(1)"
    },
    {
      "category": null,
      "dialect": "bigquery",
      "id": "bigquery-unnest",
      "kind": "legitimate",
      "sql": "SELECT tag FROM posts, UNNEST(tags) AS tag"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-azureblobstorage",
      "kind": "attack",
      "sql": "SELECT * FROM azureblobstorage('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-deltalake",
      "kind": "attack",
      "sql": "SELECT * FROM deltalake('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-executable",
      "kind": "attack",
      "sql": "SELECT * FROM executable('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-file",
      "kind": "attack",
      "sql": "SELECT * FROM file('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-filecluster",
      "kind": "attack",
      "sql": "SELECT * FROM filecluster('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-gcs",
      "kind": "attack",
      "sql": "SELECT * FROM gcs('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-hdfs",
      "kind": "attack",
      "sql": "SELECT * FROM hdfs('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-hdfscluster",
      "kind": "attack",
      "sql": "SELECT * FROM hdfscluster('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-iceberg",
      "kind": "attack",
      "sql": "SELECT * FROM iceberg('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-input",
      "kind": "attack",
      "sql": "SELECT * FROM input('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-jdbc",
      "kind": "attack",
      "sql": "SELECT * FROM jdbc('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-mongodb",
      "kind": "attack",
      "sql": "SELECT * FROM mongodb('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-mysql",
      "kind": "attack",
      "sql": "SELECT * FROM mysql('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-odbc",
      "kind": "attack",
      "sql": "SELECT * FROM odbc('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-postgresql",
      "kind": "attack",
      "sql": "SELECT * FROM postgresql('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-redis",
      "kind": "attack",
      "sql": "SELECT * FROM redis('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-remote",
      "kind": "attack",
      "sql": "SELECT * FROM remote('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-remotesecure",
      "kind": "attack",
      "sql": "SELECT * FROM remotesecure('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-s3",
      "kind": "attack",
      "sql": "SELECT * FROM s3('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-s3cluster",
      "kind": "attack",
      "sql": "SELECT * FROM s3cluster('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-sleepeachrow",
      "kind": "attack",
      "sql": "SELECT sleepEachRow(1)"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-sqlite",
      "kind": "attack",
      "sql": "SELECT * FROM sqlite('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-url",
      "kind": "attack",
      "sql": "SELECT * FROM url('x')"
    },
    {
      "category": "function",
      "dialect": "clickhouse",
      "id": "clickhouse-urlcluster",
      "kind": "attack",
      "sql": "SELECT * FROM urlcluster('x')"
    },
    {
      "category": null,
      "dialect": "duckdb",
      "id": "duckdb-list",
      "kind": "legitimate",
      "sql": "SELECT list_value(1, 2, 3) AS xs"
    },
    {
      "category": null,
      "dialect": "duckdb",
      "id": "duckdb-read-table",
      "kind": "legitimate",
      "sql": "SELECT region, avg(total) FROM orders GROUP BY region"
    },
    {
      "category": null,
      "dialect": "mysql",
      "id": "mysql-backticks",
      "kind": "legitimate",
      "sql": "SELECT `open`, `close`, `version` FROM prices"
    },
    {
      "category": "function",
      "dialect": "mysql",
      "id": "mysql-benchmark",
      "kind": "attack",
      "sql": "SELECT BENCHMARK(100000000, MD5('x'))"
    },
    {
      "category": null,
      "dialect": "mysql",
      "id": "mysql-ifnull",
      "kind": "legitimate",
      "sql": "SELECT IFNULL(discount, 0) AS d FROM orders"
    },
    {
      "category": null,
      "dialect": "mysql",
      "id": "mysql-limit",
      "kind": "legitimate",
      "sql": "SELECT id, name FROM customers ORDER BY id LIMIT 10"
    },
    {
      "category": "function",
      "dialect": "mysql",
      "id": "mysql-load-file",
      "kind": "attack",
      "sql": "SELECT LOAD_FILE('/etc/passwd')"
    },
    {
      "category": "function",
      "dialect": "mysql",
      "id": "mysql-sleep",
      "kind": "attack",
      "sql": "SELECT SLEEP(5)"
    },
    {
      "category": "function",
      "dialect": "oracle",
      "id": "oracle-dbms-pipe",
      "kind": "attack",
      "sql": "SELECT DBMS_PIPE.RECEIVE_MESSAGE('a', 10) FROM dual"
    },
    {
      "category": null,
      "dialect": "oracle",
      "id": "oracle-dual",
      "kind": "legitimate",
      "sql": "SELECT SYSDATE FROM dual"
    },
    {
      "category": null,
      "dialect": "oracle",
      "id": "oracle-rownum",
      "kind": "legitimate",
      "sql": "SELECT id FROM orders WHERE ROWNUM <= 10"
    },
    {
      "category": "function",
      "dialect": "oracle",
      "id": "oracle-sys-dbms-pipe",
      "kind": "attack",
      "sql": "SELECT SYS.DBMS_PIPE.RECEIVE_MESSAGE('a', 10) FROM dual"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-call",
      "kind": "attack",
      "sql": "CALL refresh_totals()"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-case",
      "kind": "legitimate",
      "sql": "SELECT CASE WHEN total > 100 THEN 'big' ELSE 'small' END AS size FROM orders"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-copy",
      "kind": "attack",
      "sql": "COPY invoices TO '/tmp/x.csv'"
    },
    {
      "category": "write",
      "dialect": "postgres",
      "id": "pg-cte-delete",
      "kind": "attack",
      "sql": "WITH d AS (DELETE FROM invoices RETURNING *) SELECT * FROM d"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-cte-select",
      "kind": "legitimate",
      "sql": "WITH recent AS (SELECT id, total FROM orders WHERE total > 100) SELECT count(*) FROM recent"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-delete",
      "kind": "attack",
      "sql": "DELETE FROM invoices"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-delete-flag",
      "kind": "legitimate",
      "sql": "SELECT id FROM orders WHERE delete_flag = false AND drop_rate < 0.1"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-drop",
      "kind": "attack",
      "sql": "DROP TABLE invoices"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-explain-keyword-col",
      "kind": "legitimate",
      "sql": "SELECT explain, analyze FROM notes"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-extract",
      "kind": "legitimate",
      "sql": "SELECT date_trunc('month', created_at) AS m, count(*) FROM orders GROUP BY 1 ORDER BY 1"
    },
    {
      "category": "row_lock",
      "dialect": "postgres",
      "id": "pg-for-update",
      "kind": "attack",
      "sql": "SELECT * FROM invoices FOR UPDATE"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-insert-date",
      "kind": "legitimate",
      "sql": "SELECT insert_date, exec_time, grant_amount FROM audit_rows"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-insert-select",
      "kind": "attack",
      "sql": "INSERT INTO invoices SELECT * FROM invoices"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-join-agg",
      "kind": "legitimate",
      "sql": "SELECT c.name, sum(o.total) FROM orders o JOIN customers c ON c.id = o.customer_id GROUP BY c.name HAVING sum(o.total) > 10"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-keyword-in-comment",
      "kind": "legitimate",
      "sql": "SELECT id FROM orders /* delete later */"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-keyword-in-string",
      "kind": "legitimate",
      "sql": "SELECT 'DROP TABLE orders' AS note"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-line-comment",
      "kind": "legitimate",
      "sql": "SELECT id FROM orders -- update me"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-lock-table",
      "kind": "attack",
      "sql": "LOCK TABLE invoices"
    },
    {
      "category": "function",
      "dialect": "postgres",
      "id": "pg-nextval",
      "kind": "attack",
      "sql": "SELECT nextval('invoices_id_seq')"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-open-close",
      "kind": "legitimate",
      "sql": "SELECT open, close FROM prices"
    },
    {
      "category": "function",
      "dialect": "postgres",
      "id": "pg-query-to-xml",
      "kind": "attack",
      "sql": "SELECT query_to_xml('select * from secrets', true, true, '')"
    },
    {
      "category": "function",
      "dialect": "postgres",
      "id": "pg-read-file",
      "kind": "attack",
      "sql": "SELECT pg_read_file('/etc/passwd')"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-semicolon-in-string",
      "kind": "legitimate",
      "sql": "SELECT 'a; b' AS note FROM orders"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-set-col",
      "kind": "legitimate",
      "sql": "SELECT \"set\", \"group\" FROM cards"
    },
    {
      "category": "function",
      "dialect": "postgres",
      "id": "pg-set-config",
      "kind": "attack",
      "sql": "SELECT set_config('role', 'admin', false)"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-set-role",
      "kind": "attack",
      "sql": "SET ROLE admin"
    },
    {
      "category": "function",
      "dialect": "postgres",
      "id": "pg-sleep",
      "kind": "attack",
      "sql": "SELECT pg_sleep(10)"
    },
    {
      "category": "stacked",
      "dialect": "postgres",
      "id": "pg-stacked-mixed-case",
      "kind": "attack",
      "sql": "sElEcT * fRoM invoices; dElEtE fRoM invoices"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-subquery",
      "kind": "legitimate",
      "sql": "SELECT id FROM orders WHERE customer_id IN (SELECT id FROM customers WHERE country = 'CO')"
    },
    {
      "category": "function",
      "dialect": "postgres",
      "id": "pg-table-to-xml",
      "kind": "attack",
      "sql": "SELECT table_to_xml('secrets', true, true, '')"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-union",
      "kind": "legitimate",
      "sql": "SELECT id FROM orders UNION ALL SELECT id FROM refunds"
    },
    {
      "category": "not_a_query",
      "dialect": "postgres",
      "id": "pg-update",
      "kind": "attack",
      "sql": "UPDATE invoices SET total = 0"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-updated-at",
      "kind": "legitimate",
      "sql": "SELECT id, updated_at, created_at FROM orders WHERE updated_at > now() - interval '1 day'"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-user-col",
      "kind": "legitimate",
      "sql": "SELECT user_id, user FROM sessions"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-version-col",
      "kind": "legitimate",
      "sql": "SELECT version FROM prices"
    },
    {
      "category": null,
      "dialect": "postgres",
      "id": "pg-window",
      "kind": "legitimate",
      "sql": "SELECT id, rank() OVER (PARTITION BY region ORDER BY total DESC) AS r FROM orders"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-build-stage-file-url",
      "kind": "attack",
      "sql": "SELECT build_stage_file_url('@s', 'f', 1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-get-absolute-path",
      "kind": "attack",
      "sql": "SELECT get_absolute_path('@s', 'f', 1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-get-ddl",
      "kind": "attack",
      "sql": "SELECT get_ddl('@s', 'f', 1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-get-presigned-url",
      "kind": "attack",
      "sql": "SELECT get_presigned_url('@s', 'f', 1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-get-stage-location",
      "kind": "attack",
      "sql": "SELECT get_stage_location('@s', 'f', 1)"
    },
    {
      "category": null,
      "dialect": "snowflake",
      "id": "snowflake-qualify",
      "kind": "legitimate",
      "sql": "SELECT id, total FROM orders QUALIFY row_number() OVER (ORDER BY total DESC) = 1"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-system-abort-session",
      "kind": "attack",
      "sql": "SELECT system$abort_session(1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-system-cancel-all-queries",
      "kind": "attack",
      "sql": "SELECT system$cancel_all_queries(1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-system-cancel-query",
      "kind": "attack",
      "sql": "SELECT system$cancel_query(1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-system-log",
      "kind": "attack",
      "sql": "SELECT system$log(1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-system-send-email",
      "kind": "attack",
      "sql": "SELECT system$send_email(1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-system-set-return-value",
      "kind": "attack",
      "sql": "SELECT system$set_return_value(1)"
    },
    {
      "category": "function",
      "dialect": "snowflake",
      "id": "snowflake-system-wait",
      "kind": "attack",
      "sql": "SELECT system$wait(1)"
    },
    {
      "category": "not_a_query",
      "dialect": "sqlite",
      "id": "sqlite-attach",
      "kind": "attack",
      "sql": "ATTACH DATABASE '/tmp/x.db' AS x"
    },
    {
      "category": null,
      "dialect": "sqlite",
      "id": "sqlite-like",
      "kind": "legitimate",
      "sql": "SELECT name FROM customers WHERE name LIKE 'A%'"
    },
    {
      "category": "function",
      "dialect": "sqlite",
      "id": "sqlite-load-extension",
      "kind": "attack",
      "sql": "SELECT load_extension('/tmp/evil.so')"
    },
    {
      "category": "not_a_query",
      "dialect": "sqlite",
      "id": "sqlite-pragma",
      "kind": "attack",
      "sql": "PRAGMA writable_schema = 1"
    },
    {
      "category": null,
      "dialect": "sqlite",
      "id": "sqlite-pragma-col",
      "kind": "legitimate",
      "sql": "SELECT pragma, vacuum FROM settings"
    },
    {
      "category": "function",
      "dialect": "trino",
      "id": "trino-system-query",
      "kind": "attack",
      "sql": "SELECT system.query('x')"
    },
    {
      "category": "function",
      "dialect": "trino",
      "id": "trino-system-runtime-queries",
      "kind": "attack",
      "sql": "SELECT system.runtime.queries('x')"
    },
    {
      "category": "function",
      "dialect": "trino",
      "id": "trino-system-slow-query",
      "kind": "attack",
      "sql": "SELECT system.slow_query('x')"
    },
    {
      "category": null,
      "dialect": "tsql",
      "id": "tsql-brackets",
      "kind": "legitimate",
      "sql": "SELECT [open], [close], [version] FROM dbo.prices"
    },
    {
      "category": null,
      "dialect": "tsql",
      "id": "tsql-cte",
      "kind": "legitimate",
      "sql": "WITH t AS (SELECT id, total FROM dbo.orders) SELECT SUM(total) FROM t"
    },
    {
      "category": "not_a_query",
      "dialect": "tsql",
      "id": "tsql-exec-xp-cmdshell",
      "kind": "attack",
      "sql": "EXEC xp_cmdshell 'dir'"
    },
    {
      "category": null,
      "dialect": "tsql",
      "id": "tsql-isnull",
      "kind": "legitimate",
      "sql": "SELECT ISNULL(discount, 0) AS d FROM dbo.orders"
    },
    {
      "category": "write",
      "dialect": "tsql",
      "id": "tsql-select-into",
      "kind": "attack",
      "sql": "SELECT * INTO backup FROM invoices"
    },
    {
      "category": "stacked",
      "dialect": "tsql",
      "id": "tsql-stacked-drop",
      "kind": "attack",
      "sql": "SELECT 1; DROP TABLE invoices"
    },
    {
      "category": null,
      "dialect": "tsql",
      "id": "tsql-top",
      "kind": "legitimate",
      "sql": "SELECT TOP 10 id, name FROM dbo.customers ORDER BY id"
    }
  ],
  "version": 1
}
