Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/squawk_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dir-test.workspace = true
camino.workspace = true
pg_query.workspace = true
xshell.workspace = true
annotate-snippets.workspace = true

[lints]
workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@46: Missing alter foreign data wrapper option or action.
error[syntax-error]: Missing alter foreign data wrapper option or action.
╭▸
2 │ alter foreign data wrapper w;
╰╴ ━
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@34: expected ALTER SEQUENCE option
error[syntax-error]: expected ALTER SEQUENCE option
╭▸
2 │ alter sequence s;
╰╴ ━
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@32: expected ALTER SERVER option
error[syntax-error]: expected ALTER SERVER option
╭▸
2 │ alter server s;
╰╴ ━
35 changes: 28 additions & 7 deletions crates/squawk_parser/tests/snapshots/tests__alter_table_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,31 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@23: expected command, found ADD_KW
ERROR@27: expected command, found COLUMN_KW
ERROR@34: expected command, found IDENT
ERROR@38: expected command, found BOOLEAN_KW
ERROR@175: missing comma
ERROR@505: expected COMMA
ERROR@570: unexpected comma
error[syntax-error]: expected command, found ADD_KW
╭▸
2 │ add column foo boolean;
╰╴━
error[syntax-error]: expected command, found COLUMN_KW
╭▸
2 │ add column foo boolean;
╰╴ ━
error[syntax-error]: expected command, found IDENT
╭▸
2 │ add column foo boolean;
╰╴ ━
error[syntax-error]: expected command, found BOOLEAN_KW
╭▸
2 │ add column foo boolean;
╰╴ ━
error[syntax-error]: missing comma
╭▸
8 │ validate constraint foo validate constraint b ;
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
16 │ alter c set (a b = 1);
╰╴ ━
error[syntax-error]: unexpected comma
╭▸
20 │ alter c set (a, , b = 1);
╰╴ ━
10 changes: 8 additions & 2 deletions crates/squawk_parser/tests/snapshots/tests__copy_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,11 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@36: expected COMMA
ERROR@79: expected COMMA
error[syntax-error]: expected COMMA
╭▸
2 │ copy x (i y) from '/tmp/input.file' (on_error ignore log_verbosity verbose);
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
2 │ copy x (i y) from '/tmp/input.file' (on_error ignore log_verbosity verbose);
╰╴ ━
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,23 @@ SOURCE_FILE
FUNCTION_KW "function"
WHITESPACE "\n\n"
---
ERROR@58: expected COMMA
ERROR@121: expected COMMA
ERROR@249: expected path name
ERROR@249: expected param list
error[syntax-error]: expected COMMA
╭▸
3 │ returns table (a text b int)
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
6 │ create function foo(arg float = 1 int4 = 4)
╰╴ ━
error[syntax-error]: expected path name
╭▸
13 │ create function
│ ┏━━━━━━━━━━━━━━━━┛
14 │ ┃
╰╴┗━┛
error[syntax-error]: expected param list
╭▸
13 │ create function
│ ┏━━━━━━━━━━━━━━━━┛
14 │ ┃
╰╴┗━┛
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@51: expected COMMA
error[syntax-error]: expected COMMA
╭▸
2 │ create index i on t (a nulls first b nulls first);
╰╴ ━
67 changes: 54 additions & 13 deletions crates/squawk_parser/tests/snapshots/tests__create_table_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -673,16 +673,57 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@39: expected path name
ERROR@143: unexpected trailing comma
ERROR@197: unexpected comma
ERROR@198: unexpected comma
ERROR@199: unexpected comma
ERROR@200: unexpected comma
ERROR@201: unexpected comma
ERROR@1011: expected COMMA
ERROR@1032: expected COMMA
ERROR@1116: expected COMMA
ERROR@1119: expected COMMA
ERROR@1226: expected COMMA
ERROR@1268: expected SEMICOLON
error[syntax-error]: expected path name
╭▸
2 │ create table (
╰╴ ━
error[syntax-error]: unexpected trailing comma
╭▸
10 │ create table t (a text,);
╰╴ ━
error[syntax-error]: unexpected comma
╭▸
13 │ create table t (,,,,,);
╰╴ ━
error[syntax-error]: unexpected comma
╭▸
13 │ create table t (,,,,,);
╰╴ ━
error[syntax-error]: unexpected comma
╭▸
13 │ create table t (,,,,,);
╰╴ ━
error[syntax-error]: unexpected comma
╭▸
13 │ create table t (,,,,,);
╰╴ ━
error[syntax-error]: unexpected comma
╭▸
13 │ create table t (,,,,,);
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
51 │ for values from ('2024-01-01' 1) to ('2024-04-01' 5);
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
51 │ for values from ('2024-01-01' 1) to ('2024-04-01' 5);
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
55 │ for values in (1 2 3);
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
55 │ for values in (1 2 3);
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
61 │ exclude using btree ( a with buzz.> b with <)
╰╴ ━
error[syntax-error]: expected SEMICOLON
╭▸
66 │ )
│ ┏━━┛
67 │ ┃ -- ^ missing semi
╰╴┗━┛
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@45: expected COMMA
error[syntax-error]: expected COMMA
╭▸
2 │ drop database d with ( force force );
╰╴ ━
10 changes: 8 additions & 2 deletions crates/squawk_parser/tests/snapshots/tests__drop_table_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@36: expected COMMA
ERROR@86: unexpected comma, expected a name
error[syntax-error]: expected COMMA
╭▸
2 │ drop table foo, bar buzz cascade;
╰╴ ━
error[syntax-error]: unexpected comma, expected a name
╭▸
5 │ drop table foo, , buzz cascade;
╰╴ ━
25 changes: 20 additions & 5 deletions crates/squawk_parser/tests/snapshots/tests__insert_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,23 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@51: expected COMMA
ERROR@168: missing column
ERROR@170: unexpected trailing comma
ERROR@301: expected COMMA
ERROR@304: unexpected trailing comma
error[syntax-error]: expected COMMA
╭▸
2 │ insert into t (a, b c)
╰╴ ━
error[syntax-error]: missing column
╭▸
7 │ insert into t (a,,c,)
╰╴ ━
error[syntax-error]: unexpected trailing comma
╭▸
7 │ insert into t (a,,c,)
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
13 │ values (4, 5 6,)
╰╴ ━
error[syntax-error]: unexpected trailing comma
╭▸
13 │ values (4, 5 6,)
╰╴ ━
10 changes: 8 additions & 2 deletions crates/squawk_parser/tests/snapshots/tests__prepare_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,11 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@38: expected COMMA
ERROR@44: expected COMMA
error[syntax-error]: expected COMMA
╭▸
2 │ PREPARE fooplan (int text bool, numeric) AS
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
2 │ PREPARE fooplan (int text bool, numeric) AS
╰╴ ━
10 changes: 8 additions & 2 deletions crates/squawk_parser/tests/snapshots/tests__reindex_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@39: expected COMMA
ERROR@47: expected COMMA
error[syntax-error]: expected COMMA
╭▸
2 │ reindex (concurrently verbose tablespace t) index i;
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
2 │ reindex (concurrently verbose tablespace t) index i;
╰╴ ━
30 changes: 24 additions & 6 deletions crates/squawk_parser/tests/snapshots/tests__select_cte_err.snap
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,27 @@ SOURCE_FILE
SEMICOLON ";"
WHITESPACE "\n"
---
ERROR@24: unexpected comma
ERROR@140: unexpected comma, expected a column name
ERROR@270: expected COMMA
ERROR@357: missing comma
ERROR@492: missing comma
ERROR@645: unexpected comma
error[syntax-error]: unexpected comma
╭▸
3 │ ), -- <--- extra comma!
╰╴ ━
error[syntax-error]: unexpected comma, expected a column name
╭▸
8 │ search depth first by a, , c set ordercol
╰╴ ━
error[syntax-error]: expected COMMA
╭▸
13 │ search depth first by a, b c set ordercol
╰╴ ━
error[syntax-error]: missing comma
╭▸
19 │ ) -- <-- missing a comma
╰╴ ━
error[syntax-error]: missing comma
╭▸
29 │ ) -- <-- missing a comma
╰╴ ━
error[syntax-error]: unexpected comma
╭▸
38 │ ), -- <-- extra comma
╰╴ ━
Loading
Loading