TestFallbackWithComments tests that DuckDB-specific syntax works when queries have leading comments
(t *testing.T)
| 419 | // TestFallbackWithComments tests that DuckDB-specific syntax works |
| 420 | // when queries have leading comments |
| 421 | func TestFallbackWithComments(t *testing.T) { |
| 422 | tests := []QueryTest{ |
| 423 | // Block comment before DESCRIBE |
| 424 | { |
| 425 | Name: "block_comment_describe", |
| 426 | Query: "/* comment */ DESCRIBE SELECT 1 AS num", |
| 427 | DuckgresOnly: true, |
| 428 | }, |
| 429 | // Line comment before FROM-first |
| 430 | { |
| 431 | Name: "line_comment_from_first", |
| 432 | Query: "-- get users\nFROM users SELECT name LIMIT 1", |
| 433 | DuckgresOnly: true, |
| 434 | }, |
| 435 | // Multi-line block comment before SUMMARIZE |
| 436 | { |
| 437 | Name: "multiline_comment_summarize", |
| 438 | Query: "/* multi\n line\n comment */ SUMMARIZE SELECT 1, 2, 3", |
| 439 | DuckgresOnly: true, |
| 440 | }, |
| 441 | // Multiple comments before utility command |
| 442 | { |
| 443 | Name: "multiple_comments", |
| 444 | Query: "/* first */ -- second\n/* third */ DESCRIBE SELECT 'test'::text", |
| 445 | DuckgresOnly: true, |
| 446 | }, |
| 447 | // Block comment before SELECT EXCLUDE |
| 448 | { |
| 449 | Name: "comment_select_exclude", |
| 450 | Query: "/* exclude email */ SELECT * EXCLUDE (email) FROM users LIMIT 1", |
| 451 | DuckgresOnly: true, |
| 452 | }, |
| 453 | } |
| 454 | runQueryTests(t, tests) |
| 455 | } |
| 456 | |
| 457 | // TestFallbackUtilityWithComments tests utility commands with leading comments |
| 458 | func TestFallbackUtilityWithComments(t *testing.T) { |
nothing calls this directly
no test coverage detected