Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 10c508b

Browse files
committed
Update CHANGELOG.md for v1.0.0-rc2.
1 parent c8d4089 commit 10c508b

File tree

1 file changed

+208
-1
lines changed

1 file changed

+208
-1
lines changed

CHANGELOG.md

Lines changed: 208 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,212 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased][unreleased]
55

6+
## [v1.0.0-rc2] - 2016-10-30
7+
### Changed
8+
- **BREAKING CHANGE** All named values for properties such as `variant`, `format`, and `type` should always be lowercase, even when uppercase in the input SQL (e.g., `variant` is now `natural join` instead of `NATURAL JOIN` in the AST).
9+
10+
- **BREAKING CHANGE** New format for `CASE` expression AST nodes:
11+
- `variant` `when` has a `condition` and a `consequent`
12+
- `variant` `else` has just a `consequent`
13+
- the outer `expression` is now `variant` `case` instead of `binary`
14+
- instead of taking whatever is provided between `CASE` and `WHEN` (e.g., `CASE foo WHEN ...`) and calling that the expression, it is now added as the `discriminant`
15+
16+
``` sql
17+
select
18+
case acc
19+
when a = 0 then a1
20+
when a = 1 then b1
21+
else c1
22+
end
23+
```
24+
25+
``` json
26+
{
27+
"type": "expression",
28+
"variant": "case",
29+
"expression": [
30+
{
31+
"type": "condition",
32+
"variant": "when",
33+
"condition": {
34+
"type": "expression",
35+
"format": "binary",
36+
"variant": "operation",
37+
"operation": "=",
38+
"left": {
39+
"type": "identifier",
40+
"variant": "column",
41+
"name": "a"
42+
},
43+
"right": {
44+
"type": "literal",
45+
"variant": "decimal",
46+
"value": "0"
47+
}
48+
},
49+
"consequent": {
50+
"type": "identifier",
51+
"variant": "column",
52+
"name": "a1"
53+
}
54+
},
55+
{
56+
"type": "condition",
57+
"variant": "when",
58+
"condition": {
59+
"type": "expression",
60+
"format": "binary",
61+
"variant": "operation",
62+
"operation": "=",
63+
"left": {
64+
"type": "identifier",
65+
"variant": "column",
66+
"name": "a"
67+
},
68+
"right": {
69+
"type": "literal",
70+
"variant": "decimal",
71+
"value": "1"
72+
}
73+
},
74+
"consequent": {
75+
"type": "identifier",
76+
"variant": "column",
77+
"name": "b1"
78+
}
79+
},
80+
{
81+
"type": "condition",
82+
"variant": "else",
83+
"consequent": {
84+
"type": "identifier",
85+
"variant": "column",
86+
"name": "c1"
87+
}
88+
}
89+
],
90+
"discriminant": {
91+
"type": "identifier",
92+
"variant": "column",
93+
"name": "acc"
94+
}
95+
}
96+
```
97+
98+
- **BREAKING CHANGE** New format for `EXISTS` expression nodes. Use `expression` node in `condition` for `IF NOT EXISTS`. `NOT EXISTS`, and `EXISTS` modifiers instead of a string value.
99+
- `CREATE TABLE` statement
100+
101+
``` sql
102+
create table if not exists foo(id int)
103+
```
104+
105+
``` json
106+
{
107+
"type": "statement",
108+
"name": {
109+
"type": "identifier",
110+
"variant": "table",
111+
"name": "foo"
112+
},
113+
"variant": "create",
114+
"format": "table",
115+
"definition": [
116+
{
117+
"type": "definition",
118+
"variant": "column",
119+
"name": "id",
120+
"definition": [],
121+
"datatype": {
122+
"type": "datatype",
123+
"variant": "int",
124+
"affinity": "integer"
125+
}
126+
}
127+
],
128+
"condition": [
129+
{
130+
"type": "condition",
131+
"variant": "if",
132+
"condition": {
133+
"type": "expression",
134+
"variant": "exists",
135+
"operator": "not exists"
136+
}
137+
}
138+
]
139+
}
140+
```
141+
142+
- `DROP TABLE` statement
143+
144+
``` sql
145+
drop table if exists foo
146+
```
147+
148+
``` json
149+
{
150+
"type": "statement",
151+
"target": {
152+
"type": "identifier",
153+
"variant": "table",
154+
"name": "foo"
155+
},
156+
"variant": "drop",
157+
"format": "table",
158+
"condition": [
159+
{
160+
"type": "condition",
161+
"variant": "if",
162+
"condition": {
163+
"type": "expression",
164+
"variant": "exists",
165+
"operator": "exists"
166+
}
167+
}
168+
]
169+
}
170+
```
171+
172+
- `NOT EXISTS` expression
173+
174+
``` sql
175+
select a
176+
where not exists (select b)
177+
```
178+
179+
``` json
180+
{
181+
"type": "statement",
182+
"variant": "select",
183+
"result": [
184+
{
185+
"type": "identifier",
186+
"variant": "column",
187+
"name": "a"
188+
}
189+
],
190+
"where": [
191+
{
192+
"type": "expression",
193+
"format": "unary",
194+
"variant": "exists",
195+
"expression": {
196+
"type": "statement",
197+
"variant": "select",
198+
"result": [
199+
{
200+
"type": "identifier",
201+
"variant": "column",
202+
"name": "b"
203+
}
204+
]
205+
},
206+
"operator": "not exists"
207+
}
208+
]
209+
}
210+
```
211+
6212
## [v1.0.0-rc1] - 2016-10-16
7213
### Added
8214
- The root node of the AST now has `type` and `variant` properties:
@@ -1032,7 +1238,8 @@ part of table names, column names, aliases, etc... This also addresses issues th
10321238
### Added
10331239
- First working version of sqlite-parser
10341240

1035-
[unreleased]: https://github.com/codeschool/sqlite-parser/compare/v1.0.0-rc1...HEAD
1241+
[unreleased]: https://github.com/codeschool/sqlite-parser/compare/v1.0.0-rc2...HEAD
1242+
[v1.0.0-rc2]: https://github.com/codeschool/sqlite-parser/compare/v1.0.0-rc1...v1.0.0-rc2
10361243
[v1.0.0-rc1]: https://github.com/codeschool/sqlite-parser/compare/v0.14.5...v1.0.0-rc1
10371244
[v0.14.5]: https://github.com/codeschool/sqlite-parser/compare/v0.14.4...v0.14.5
10381245
[v0.14.4]: https://github.com/codeschool/sqlite-parser/compare/v0.14.3...v0.14.4

0 commit comments

Comments
 (0)