TestFallbackToNativeDuckDB tests that DuckDB-specific syntax that isn't valid PostgreSQL is automatically detected and executed via the native DuckDB fallback. This is the "two-tier query pathway" feature.
(t *testing.T)
| 8 | // PostgreSQL is automatically detected and executed via the native DuckDB fallback. |
| 9 | // This is the "two-tier query pathway" feature. |
| 10 | func TestFallbackToNativeDuckDB(t *testing.T) { |
| 11 | // These tests only run on Duckgres since the syntax is DuckDB-specific |
| 12 | // and won't work on PostgreSQL |
| 13 | tests := []QueryTest{ |
| 14 | // DuckDB DESCRIBE statement |
| 15 | { |
| 16 | Name: "describe_select", |
| 17 | Query: "DESCRIBE SELECT 1 AS num", |
| 18 | DuckgresOnly: true, |
| 19 | }, |
| 20 | // DuckDB SUMMARIZE statement |
| 21 | { |
| 22 | Name: "summarize_users", |
| 23 | Query: "SUMMARIZE SELECT * FROM users", |
| 24 | DuckgresOnly: true, |
| 25 | }, |
| 26 | // DuckDB FROM-first syntax |
| 27 | { |
| 28 | Name: "from_first_select", |
| 29 | Query: "FROM users SELECT name LIMIT 3", |
| 30 | DuckgresOnly: true, |
| 31 | }, |
| 32 | // DuckDB database functions |
| 33 | { |
| 34 | Name: "duckdb_databases", |
| 35 | Query: "SELECT * FROM duckdb_databases()", |
| 36 | DuckgresOnly: true, |
| 37 | }, |
| 38 | // DuckDB pragma as table-function (some pragmas support this) |
| 39 | { |
| 40 | Name: "pragma_table_info", |
| 41 | Query: "SELECT * FROM pragma_table_info('users')", |
| 42 | DuckgresOnly: true, |
| 43 | }, |
| 44 | // DuckDB tables/views function |
| 45 | { |
| 46 | Name: "duckdb_tables", |
| 47 | Query: "SELECT * FROM duckdb_tables() LIMIT 3", |
| 48 | DuckgresOnly: true, |
| 49 | }, |
| 50 | // DuckDB SELECT with EXCLUDE |
| 51 | { |
| 52 | Name: "select_exclude", |
| 53 | Query: "SELECT * EXCLUDE (email) FROM users LIMIT 3", |
| 54 | DuckgresOnly: true, |
| 55 | }, |
| 56 | // DuckDB SELECT with REPLACE |
| 57 | { |
| 58 | Name: "select_replace", |
| 59 | Query: "SELECT * REPLACE (upper(name) AS name) FROM users LIMIT 3", |
| 60 | DuckgresOnly: true, |
| 61 | }, |
| 62 | // DuckDB QUALIFY clause |
| 63 | { |
| 64 | Name: "qualify_row_number", |
| 65 | Query: "SELECT id, name FROM users QUALIFY row_number() OVER (ORDER BY id) <= 3", |
| 66 | DuckgresOnly: true, |
| 67 | }, |
nothing calls this directly
no test coverage detected