-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
11,247 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[alias] | ||
snap = "insta test" | ||
xtask = "run --package xtask --" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
advisory_lock | ||
aggregates | ||
alter_generic | ||
alter_operator | ||
|
32 changes: 32 additions & 0 deletions
32
crates/parser/tests/snapshots/statements/valid/advisory_lock@1.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
source: crates/parser/tests/statement_parser_test.rs | ||
description: "--\n-- ADVISORY LOCKS\n--\n\nBEGIN;" | ||
--- | ||
Parse { | ||
cst: SourceFile@0..31 | ||
SqlComment@0..2 "--" | ||
Newline@2..3 "\n" | ||
SqlComment@3..20 "-- ADVISORY LOCKS" | ||
Newline@20..21 "\n" | ||
SqlComment@21..23 "--" | ||
Newline@23..25 "\n\n" | ||
TransactionStmt@25..31 | ||
BeginP@25..30 "BEGIN" | ||
Ascii59@30..31 ";" | ||
, | ||
errors: [], | ||
stmts: [ | ||
RawStmt { | ||
stmt: TransactionStmt( | ||
TransactionStmt { | ||
kind: TransStmtBegin, | ||
options: [], | ||
savepoint_name: "", | ||
gid: "", | ||
chain: false, | ||
}, | ||
), | ||
range: 24..30, | ||
}, | ||
], | ||
} |
363 changes: 363 additions & 0 deletions
363
crates/parser/tests/snapshots/statements/valid/advisory_lock@10.snap
Large diffs are not rendered by default.
Oops, something went wrong.
487 changes: 487 additions & 0 deletions
487
crates/parser/tests/snapshots/statements/valid/advisory_lock@11.snap
Large diffs are not rendered by default.
Oops, something went wrong.
361 changes: 361 additions & 0 deletions
361
crates/parser/tests/snapshots/statements/valid/advisory_lock@12.snap
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
crates/parser/tests/snapshots/statements/valid/advisory_lock@13.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: crates/parser/tests/statement_parser_test.rs | ||
description: ROLLBACK; | ||
--- | ||
Parse { | ||
cst: SourceFile@0..9 | ||
Rollback@0..8 "ROLLBACK" | ||
Ascii59@8..9 ";" | ||
, | ||
errors: [], | ||
stmts: [], | ||
} |
487 changes: 487 additions & 0 deletions
487
crates/parser/tests/snapshots/statements/valid/advisory_lock@14.snap
Large diffs are not rendered by default.
Oops, something went wrong.
683 changes: 683 additions & 0 deletions
683
crates/parser/tests/snapshots/statements/valid/advisory_lock@15.snap
Large diffs are not rendered by default.
Oops, something went wrong.
186 changes: 186 additions & 0 deletions
186
crates/parser/tests/snapshots/statements/valid/advisory_lock@16.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
--- | ||
source: crates/parser/tests/statement_parser_test.rs | ||
description: "SELECT count(*) FROM pg_locks WHERE locktype = 'advisory';" | ||
--- | ||
Parse { | ||
cst: SourceFile@0..58 | ||
SelectStmt@0..58 | ||
Select@0..6 "SELECT" | ||
Whitespace@6..7 " " | ||
ResTarget@7..14 | ||
FuncCall@7..14 | ||
Ident@7..12 "count" | ||
Ascii40@12..13 "(" | ||
Ascii42@13..14 "*" | ||
Ascii41@14..15 ")" | ||
Whitespace@15..16 " " | ||
From@16..20 "FROM" | ||
Whitespace@20..21 " " | ||
RangeVar@21..29 | ||
Ident@21..29 "pg_locks" | ||
Whitespace@29..30 " " | ||
Where@30..35 "WHERE" | ||
Whitespace@35..36 " " | ||
AExpr@36..57 | ||
ColumnRef@36..44 | ||
Ident@36..44 "locktype" | ||
Whitespace@44..45 " " | ||
Ascii61@45..46 "=" | ||
Whitespace@46..47 " " | ||
AConst@47..57 | ||
Sconst@47..57 "'advisory'" | ||
Ascii59@57..58 ";" | ||
, | ||
errors: [], | ||
stmts: [ | ||
RawStmt { | ||
stmt: SelectStmt( | ||
SelectStmt { | ||
distinct_clause: [], | ||
into_clause: None, | ||
target_list: [ | ||
Node { | ||
node: Some( | ||
ResTarget( | ||
ResTarget { | ||
name: "", | ||
indirection: [], | ||
val: Some( | ||
Node { | ||
node: Some( | ||
FuncCall( | ||
FuncCall { | ||
funcname: [ | ||
Node { | ||
node: Some( | ||
String( | ||
String { | ||
sval: "count", | ||
}, | ||
), | ||
), | ||
}, | ||
], | ||
args: [], | ||
agg_order: [], | ||
agg_filter: None, | ||
over: None, | ||
agg_within_group: false, | ||
agg_star: true, | ||
agg_distinct: false, | ||
func_variadic: false, | ||
funcformat: CoerceExplicitCall, | ||
location: 7, | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
location: 7, | ||
}, | ||
), | ||
), | ||
}, | ||
], | ||
from_clause: [ | ||
Node { | ||
node: Some( | ||
RangeVar( | ||
RangeVar { | ||
catalogname: "", | ||
schemaname: "", | ||
relname: "pg_locks", | ||
inh: true, | ||
relpersistence: "p", | ||
alias: None, | ||
location: 21, | ||
}, | ||
), | ||
), | ||
}, | ||
], | ||
where_clause: Some( | ||
Node { | ||
node: Some( | ||
AExpr( | ||
AExpr { | ||
kind: AexprOp, | ||
name: [ | ||
Node { | ||
node: Some( | ||
String( | ||
String { | ||
sval: "=", | ||
}, | ||
), | ||
), | ||
}, | ||
], | ||
lexpr: Some( | ||
Node { | ||
node: Some( | ||
ColumnRef( | ||
ColumnRef { | ||
fields: [ | ||
Node { | ||
node: Some( | ||
String( | ||
String { | ||
sval: "locktype", | ||
}, | ||
), | ||
), | ||
}, | ||
], | ||
location: 36, | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
rexpr: Some( | ||
Node { | ||
node: Some( | ||
AConst( | ||
AConst { | ||
isnull: false, | ||
location: 47, | ||
val: Some( | ||
Sval( | ||
String { | ||
sval: "advisory", | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
location: 45, | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
group_clause: [], | ||
group_distinct: false, | ||
having_clause: None, | ||
window_clause: [], | ||
values_lists: [], | ||
sort_clause: [], | ||
limit_offset: None, | ||
limit_count: None, | ||
limit_option: Default, | ||
locking_clause: [], | ||
with_clause: None, | ||
op: SetopNone, | ||
all: false, | ||
larg: None, | ||
rarg: None, | ||
}, | ||
), | ||
range: 0..57, | ||
}, | ||
], | ||
} |
26 changes: 26 additions & 0 deletions
26
crates/parser/tests/snapshots/statements/valid/advisory_lock@17.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
source: crates/parser/tests/statement_parser_test.rs | ||
description: BEGIN; | ||
--- | ||
Parse { | ||
cst: SourceFile@0..6 | ||
TransactionStmt@0..6 | ||
BeginP@0..5 "BEGIN" | ||
Ascii59@5..6 ";" | ||
, | ||
errors: [], | ||
stmts: [ | ||
RawStmt { | ||
stmt: TransactionStmt( | ||
TransactionStmt { | ||
kind: TransStmtBegin, | ||
options: [], | ||
savepoint_name: "", | ||
gid: "", | ||
chain: false, | ||
}, | ||
), | ||
range: 0..5, | ||
}, | ||
], | ||
} |
Oops, something went wrong.