Skip to content

Commit 8b2fd25

Browse files
committed
add snapshots
1 parent 639bb17 commit 8b2fd25

File tree

7 files changed

+363
-2
lines changed

7 files changed

+363
-2
lines changed

Diff for: crates/parser/tests/data/statements/valid/0047.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CREATE DATABASE x OWNER abc CONNECTION LIMIT 5;
2-
CREATE DATABASE x ENCODING \"SQL_ASCII\";
3-
CREATE DATABASE x LC_COLLATE \"en_US.UTF-8\";
2+
CREATE DATABASE x ENCODING "SQL_ASCII";
3+
CREATE DATABASE x LC_COLLATE "en_US.UTF-8";
44
CREATE DATABASE x LOCATION DEFAULT;
55
CREATE DATABASE x TABLESPACE abc;
66
CREATE DATABASE x TEMPLATE TRUE;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
source: crates/parser/tests/statement_parser_test.rs
3+
description: CREATE DATABASE x OWNER abc CONNECTION LIMIT 5;
4+
---
5+
Parse {
6+
cst: SourceFile@0..47
7+
CreatedbStmt@0..47
8+
Create@0..6 "CREATE"
9+
Whitespace@6..7 " "
10+
Database@7..15 "DATABASE"
11+
Whitespace@15..16 " "
12+
Ident@16..17 "x"
13+
Whitespace@17..18 " "
14+
DefElem@18..27
15+
Owner@18..23 "OWNER"
16+
Whitespace@23..24 " "
17+
Ident@24..27 "abc"
18+
Whitespace@27..28 " "
19+
DefElem@28..38
20+
Connection@28..38 "CONNECTION"
21+
Whitespace@38..39 " "
22+
Limit@39..44 "LIMIT"
23+
Whitespace@44..45 " "
24+
Iconst@45..46 "5"
25+
Ascii59@46..47 ";"
26+
,
27+
errors: [],
28+
stmts: [
29+
RawStmt {
30+
stmt: CreatedbStmt(
31+
CreatedbStmt {
32+
dbname: "x",
33+
options: [
34+
Node {
35+
node: Some(
36+
DefElem(
37+
DefElem {
38+
defnamespace: "",
39+
defname: "owner",
40+
arg: Some(
41+
Node {
42+
node: Some(
43+
String(
44+
String {
45+
sval: "abc",
46+
},
47+
),
48+
),
49+
},
50+
),
51+
defaction: DefelemUnspec,
52+
location: 18,
53+
},
54+
),
55+
),
56+
},
57+
Node {
58+
node: Some(
59+
DefElem(
60+
DefElem {
61+
defnamespace: "",
62+
defname: "connection_limit",
63+
arg: Some(
64+
Node {
65+
node: Some(
66+
Integer(
67+
Integer {
68+
ival: 5,
69+
},
70+
),
71+
),
72+
},
73+
),
74+
defaction: DefelemUnspec,
75+
location: 28,
76+
},
77+
),
78+
),
79+
},
80+
],
81+
},
82+
),
83+
range: 0..46,
84+
},
85+
],
86+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
source: crates/parser/tests/statement_parser_test.rs
3+
description: "\nCREATE DATABASE x ENCODING \"SQL_ASCII\";"
4+
---
5+
Parse {
6+
cst: SourceFile@0..40
7+
Newline@0..1 "\n"
8+
CreatedbStmt@1..40
9+
Create@1..7 "CREATE"
10+
Whitespace@7..8 " "
11+
Database@8..16 "DATABASE"
12+
Whitespace@16..17 " "
13+
Ident@17..18 "x"
14+
Whitespace@18..19 " "
15+
DefElem@19..39
16+
Encoding@19..27 "ENCODING"
17+
Whitespace@27..28 " "
18+
Ident@28..39 "\"SQL_ASCII\""
19+
Ascii59@39..40 ";"
20+
,
21+
errors: [],
22+
stmts: [
23+
RawStmt {
24+
stmt: CreatedbStmt(
25+
CreatedbStmt {
26+
dbname: "x",
27+
options: [
28+
Node {
29+
node: Some(
30+
DefElem(
31+
DefElem {
32+
defnamespace: "",
33+
defname: "encoding",
34+
arg: Some(
35+
Node {
36+
node: Some(
37+
String(
38+
String {
39+
sval: "SQL_ASCII",
40+
},
41+
),
42+
),
43+
},
44+
),
45+
defaction: DefelemUnspec,
46+
location: 18,
47+
},
48+
),
49+
),
50+
},
51+
],
52+
},
53+
),
54+
range: 0..39,
55+
},
56+
],
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
source: crates/parser/tests/statement_parser_test.rs
3+
description: "\nCREATE DATABASE x LC_COLLATE \"en_US.UTF-8\";"
4+
---
5+
Parse {
6+
cst: SourceFile@0..44
7+
Newline@0..1 "\n"
8+
CreatedbStmt@1..44
9+
Create@1..7 "CREATE"
10+
Whitespace@7..8 " "
11+
Database@8..16 "DATABASE"
12+
Whitespace@16..17 " "
13+
Ident@17..18 "x"
14+
Whitespace@18..19 " "
15+
DefElem@19..43
16+
Ident@19..29 "LC_COLLATE"
17+
Whitespace@29..30 " "
18+
Ident@30..43 "\"en_US.UTF-8\""
19+
Ascii59@43..44 ";"
20+
,
21+
errors: [],
22+
stmts: [
23+
RawStmt {
24+
stmt: CreatedbStmt(
25+
CreatedbStmt {
26+
dbname: "x",
27+
options: [
28+
Node {
29+
node: Some(
30+
DefElem(
31+
DefElem {
32+
defnamespace: "",
33+
defname: "lc_collate",
34+
arg: Some(
35+
Node {
36+
node: Some(
37+
String(
38+
String {
39+
sval: "en_US.UTF-8",
40+
},
41+
),
42+
),
43+
},
44+
),
45+
defaction: DefelemUnspec,
46+
location: 18,
47+
},
48+
),
49+
),
50+
},
51+
],
52+
},
53+
),
54+
range: 0..43,
55+
},
56+
],
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
source: crates/parser/tests/statement_parser_test.rs
3+
description: "\nCREATE DATABASE x LOCATION DEFAULT;"
4+
---
5+
Parse {
6+
cst: SourceFile@0..36
7+
Newline@0..1 "\n"
8+
CreatedbStmt@1..36
9+
Create@1..7 "CREATE"
10+
Whitespace@7..8 " "
11+
Database@8..16 "DATABASE"
12+
Whitespace@16..17 " "
13+
Ident@17..18 "x"
14+
Whitespace@18..19 " "
15+
DefElem@19..27
16+
Location@19..27 "LOCATION"
17+
Whitespace@27..28 " "
18+
Default@28..35 "DEFAULT"
19+
Ascii59@35..36 ";"
20+
,
21+
errors: [],
22+
stmts: [
23+
RawStmt {
24+
stmt: CreatedbStmt(
25+
CreatedbStmt {
26+
dbname: "x",
27+
options: [
28+
Node {
29+
node: Some(
30+
DefElem(
31+
DefElem {
32+
defnamespace: "",
33+
defname: "location",
34+
arg: None,
35+
defaction: DefelemUnspec,
36+
location: 18,
37+
},
38+
),
39+
),
40+
},
41+
],
42+
},
43+
),
44+
range: 0..35,
45+
},
46+
],
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
source: crates/parser/tests/statement_parser_test.rs
3+
description: "\nCREATE DATABASE x TABLESPACE abc;"
4+
---
5+
Parse {
6+
cst: SourceFile@0..34
7+
Newline@0..1 "\n"
8+
CreatedbStmt@1..34
9+
Create@1..7 "CREATE"
10+
Whitespace@7..8 " "
11+
Database@8..16 "DATABASE"
12+
Whitespace@16..17 " "
13+
Ident@17..18 "x"
14+
Whitespace@18..19 " "
15+
DefElem@19..33
16+
Tablespace@19..29 "TABLESPACE"
17+
Whitespace@29..30 " "
18+
Ident@30..33 "abc"
19+
Ascii59@33..34 ";"
20+
,
21+
errors: [],
22+
stmts: [
23+
RawStmt {
24+
stmt: CreatedbStmt(
25+
CreatedbStmt {
26+
dbname: "x",
27+
options: [
28+
Node {
29+
node: Some(
30+
DefElem(
31+
DefElem {
32+
defnamespace: "",
33+
defname: "tablespace",
34+
arg: Some(
35+
Node {
36+
node: Some(
37+
String(
38+
String {
39+
sval: "abc",
40+
},
41+
),
42+
),
43+
},
44+
),
45+
defaction: DefelemUnspec,
46+
location: 18,
47+
},
48+
),
49+
),
50+
},
51+
],
52+
},
53+
),
54+
range: 0..33,
55+
},
56+
],
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
source: crates/parser/tests/statement_parser_test.rs
3+
description: "\nCREATE DATABASE x TEMPLATE TRUE;"
4+
---
5+
Parse {
6+
cst: SourceFile@0..33
7+
Newline@0..1 "\n"
8+
CreatedbStmt@1..33
9+
Create@1..7 "CREATE"
10+
Whitespace@7..8 " "
11+
Database@8..16 "DATABASE"
12+
Whitespace@16..17 " "
13+
Ident@17..18 "x"
14+
Whitespace@18..19 " "
15+
DefElem@19..32
16+
Template@19..27 "TEMPLATE"
17+
Whitespace@27..28 " "
18+
TrueP@28..32 "TRUE"
19+
Ascii59@32..33 ";"
20+
,
21+
errors: [],
22+
stmts: [
23+
RawStmt {
24+
stmt: CreatedbStmt(
25+
CreatedbStmt {
26+
dbname: "x",
27+
options: [
28+
Node {
29+
node: Some(
30+
DefElem(
31+
DefElem {
32+
defnamespace: "",
33+
defname: "template",
34+
arg: Some(
35+
Node {
36+
node: Some(
37+
String(
38+
String {
39+
sval: "true",
40+
},
41+
),
42+
),
43+
},
44+
),
45+
defaction: DefelemUnspec,
46+
location: 18,
47+
},
48+
),
49+
),
50+
},
51+
],
52+
},
53+
),
54+
range: 0..32,
55+
},
56+
],
57+
}

0 commit comments

Comments
 (0)