Skip to content

Commit 04c72be

Browse files
authored
Merge pull request #5 from sqlparser-rs/main
Sync new additions to sql parser
2 parents 4c8933c + 39980e8 commit 04c72be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+16575
-3075
lines changed

.github/workflows/rust.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,25 @@ jobs:
7575
uses: actions/checkout@v2
7676
- name: Test
7777
run: cargo test --all-features
78+
79+
test-coverage:
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Setup Rust
83+
uses: hecrj/setup-rust-action@v1
84+
with:
85+
rust-version: stable
86+
- name: Install Tarpaulin
87+
uses: actions-rs/[email protected]
88+
with:
89+
crate: cargo-tarpaulin
90+
version: 0.14.2
91+
use-tool-cache: true
92+
- name: Checkout
93+
uses: actions/checkout@v2
7894
- name: Coverage
79-
if: matrix.rust == 'stable'
8095
run: cargo tarpaulin -o Lcov --output-dir ./coverage
8196
- name: Coveralls
82-
if: matrix.rust == 'stable'
8397
uses: coverallsapp/github-action@master
8498
with:
8599
github-token: ${{ secrets.GITHUB_TOKEN }}

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rust 1.75.0

CHANGELOG.md

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

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project aims to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
Given that the parser produces a typed AST, any changes to the AST will technically be breaking and thus will result in a `0.(N+1)` version. We document changes that break via addition as "Added".
6+
Given that the parser produces a typed AST, any changes to the AST will
7+
technically be breaking and thus will result in a `0.(N+1)` version. We document
8+
changes that break via addition as "Added".
79

810
## [Unreleased]
911
Check https://github.com/sqlparser-rs/sqlparser-rs/commits/main for undocumented changes.
1012

13+
## [0.45.0] 2024-04-12
14+
15+
### Added
16+
* Support `DateTimeField` variants: `CUSTOM` and `WEEK(MONDAY)` (#1191) - Thanks @iffyio
17+
* Support for arbitrary expr in `MapAccessSyntax` (#1179) - Thanks @iffyio
18+
* Support unquoted hyphen in table/view declaration for BigQuery (#1178) - Thanks @iffyio
19+
* Support `CREATE/DROP SECRET` for duckdb dialect (#1208) - Thanks @JichaoS
20+
* Support MySQL `UNIQUE` table constraint (#1164) - Thanks @Nikita-str
21+
* Support tailing commas on Snowflake. (#1205) - Thanks @yassun7010
22+
* Support `[FIRST | AFTER column_name]` in `ALTER TABLE` for MySQL (#1180) - Thanks @xring
23+
* Support inline comment with hash syntax for BigQuery (#1192) - Thanks @iffyio
24+
* Support named windows in OVER (window_definition) clause (#1166) - Thanks @Nikita-str
25+
* Support PARALLEL ... and for ..ON NULL INPUT ... to CREATE FUNCTION` (#1202) - Thanks @dimfeld
26+
* Support DuckDB functions named arguments with assignment operator (#1195) - Thanks @alamb
27+
* Support DuckDB struct literal syntax (#1194) - Thanks @gstvg
28+
* Support `$$` in generic dialect ... (#1185)- Thanks @milenkovicm
29+
* Support row_alias and col_aliases in `INSERT` statement for MySQL and Generic dialects (#1136) - Thanks @emin100
30+
31+
### Fixed
32+
* Fix dollar quoted string tokenizer (#1193) - Thanks @ZacJW
33+
* Do not allocate in `impl Display` for `DateTimeField` (#1209) - Thanks @alamb
34+
* Fix parse `COPY INTO` stage names without parens for SnowFlake (#1187) - Thanks @mobuchowski
35+
* Solve stack overflow on RecursionLimitExceeded on debug builds (#1171) - Thanks @Nikita-str
36+
* Fix parsing of equality binary operator in function argument (#1182) - Thanks @jmhain
37+
* Fix some comments (#1184) - Thanks @sunxunle
38+
39+
### Changed
40+
* Cleanup `CREATE FUNCTION` tests (#1203) - Thanks @alamb
41+
* Parse `SUBSTRING FROM` syntax in all dialects, reflect change in the AST (#1173) - Thanks @lovasoa
42+
* Add identifier quote style to Dialect trait (#1170) - Thanks @backkem
43+
44+
## [0.44.0] 2024-03-02
45+
46+
### Added
47+
* Support EXPLAIN / DESCR / DESCRIBE [FORMATTED | EXTENDED] (#1156) - Thanks @jonathanlehtoalamb
48+
* Support ALTER TABLE ... SET LOCATION (#1154) - Thanks @jonathanlehto
49+
* Support `ROW FORMAT DELIMITED` in Hive (#1155) - Thanks @jonathanlehto
50+
* Support `SERDEPROPERTIES` for `CREATE TABLE` with Hive (#1152) - Thanks @jonathanlehto
51+
* Support `EXECUTE ... USING` for Postgres (#1153) - Thanks @jonathanlehto
52+
* Support Postgres style `CREATE FUNCTION` in GenericDialect (#1159) - Thanks @alamb
53+
* Support `SET TBLPROPERTIES` (#1151) - Thanks @jonathanlehto
54+
* Support `UNLOAD` statement (#1150) - Thanks @jonathanlehto
55+
* Support `MATERIALIZED CTEs` (#1148) - Thanks @ReppCodes
56+
* Support `DECLARE` syntax for snowflake and bigquery (#1122) - Thanks @iffyio
57+
* Support `SELECT AS VALUE` and `SELECT AS STRUCT` for BigQuery (#1135) - Thanks @lustefaniak
58+
* Support `(+)` outer join syntax (#1145) - Thanks @jmhain
59+
* Support `INSERT INTO ... SELECT ... RETURNING`(#1132) - Thanks @lovasoa
60+
* Support DuckDB `INSTALL` and `LOAD` (#1127) - Thanks @universalmind303
61+
* Support `=` operator in function args (#1128) - Thanks @universalmind303
62+
* Support `CREATE VIEW IF NOT EXISTS` (#1118) - Thanks @7phs
63+
* Support `UPDATE FROM` for SQLite (further to #694) (#1117) - Thanks @ggaughan
64+
* Support optional `DELETE FROM` statement (#1120) - Thanks @iffyio
65+
* Support MySQL `SHOW STATUS` statement (#1119) - Thanks invm
66+
67+
### Fixed
68+
* Clean up nightly clippy lints (#1158) - Thanks @alamb
69+
* Handle escape, unicode, and hex in tokenize_escaped_single_quoted_string (#1146) - Thanks @JasonLi-cn
70+
* Fix panic while parsing `REPLACE` (#1140) - THanks @jjbayer
71+
* Fix clippy warning from rust 1.76 (#1130) - Thanks @alamb
72+
* Fix release instructions (#1115) - Thanks @alamb
73+
74+
### Changed
75+
* Add `parse_keyword_with_tokens` for paring keyword and tokens combination (#1141) - Thanks @viirya
76+
* Add ParadeDB to list of known users (#1142) - Thanks @philippemnoel
77+
* Accept JSON_TABLE both as an unquoted table name and a table-valued function (#1134) - Thanks @lovasoa
78+
79+
80+
## [0.43.1] 2024-01-22
81+
### Changes
82+
* Fixed CHANGELOG
83+
84+
85+
## [0.43.0] 2024-01-22
86+
* NO CHANGES
87+
88+
## [0.42.0] 2024-01-22
89+
90+
### Added
91+
* Support for constraint `CHARACTERISTICS` clause (#1099) - Thanks @dimfeld
92+
* Support for unquoted hyphenated identifiers on bigquery (#1109) - Thanks @jmhain
93+
* Support `BigQuery` table and view options (#1061) - Thanks @iffyio
94+
* Support Postgres operators for the LIKE expression variants (#1096) - Thanks @gruuya
95+
* Support "timezone_region" and "timezone_abbr" for `EXTRACT` (and `DATE_PART`) (#1090) - Thanks @alexander-beedie
96+
* Support `JSONB` datatype (#1089) - Thanks @alexander-beedie
97+
* Support PostgreSQL `^@` starts-with operator (#1091) - Thanks @alexander-beedie
98+
* Support PostgreSQL Insert table aliases (#1069) (#1084) - Thanks @boydjohnson
99+
* Support PostgreSQL `CREATE EXTENSION` (#1078) - Thanks @tobyhede
100+
* Support PostgreSQL `ADD GENERATED` in `ALTER COLUMN` statements (#1079) - Thanks @tobyhede
101+
* Support SQLite column definitions with no type (#1075) - Thanks @takluyver
102+
* Support PostgreSQL `ENABLE` and `DISABLE` on `ALTER TABLE` (#1077) - Thanks @tobyhede
103+
* Support MySQL `FLUSH` statement (#1076) - Thanks @emin100
104+
* Support Mysql `REPLACE` statement and `PRIORITY` clause of `INSERT` (#1072) - Thanks @emin100
105+
106+
### Fixed
107+
* Fix `:start` and `:end` json accesses on SnowFlake (#1110) - Thanks @jmhain
108+
* Fix array_agg wildcard behavior (#1093) - Thanks @ReppCodes
109+
* Error on dangling `NO` in `CREATE SEQUENCE` options (#1104) - Thanks @PartiallyTyped
110+
* Allow string values in `PRAGMA` commands (#1101) - Thanks @invm
111+
112+
### Changed
113+
* Use `Option<Expr>` for Min and Max vals in Seq Opts, fix alter col seq display (#1106) - Thanks @PartiallyTyped
114+
* Replace `AtomicUsize` with Cell<usize> in the recursion counter (#1098) - Thanks @wzzzzd
115+
* Add Qrlew as a user in README.md (#1107) - Thanks @ngrislain
116+
* Add APIs to reuse token buffers in `Tokenizer` (#1094) - Thanks @0rphon
117+
* Bump version of `sqlparser-derive` to 0.2.2 (#1083) - Thanks @alamb
118+
119+
## [0.41.0] 2023-12-22
120+
121+
### Added
122+
* Support `DEFERRED`, `IMMEDIATE`, and `EXCLUSIVE` in SQLite's `BEGIN TRANSACTION` command (#1067) - Thanks @takaebato
123+
* Support generated columns skipping `GENERATED ALWAYS` keywords (#1058) - Thanks @takluyver
124+
* Support `LOCK/UNLOCK TABLES` for MySQL (#1059) - Thanks @zzzdong
125+
* Support `JSON_TABLE` (#1062) - Thanks @lovasoa
126+
* Support `CALL` statements (#1063) - Thanks @lovasoa
127+
128+
### Fixed
129+
* fix rendering of SELECT TOP (#1070) for Snowflake - Thanks jmhain
130+
131+
### Changed
132+
* Improve documentation formatting (#1068) - Thanks @alamb
133+
* Replace type_id() by trait method to allow wrapping dialects (#1065) - Thanks @jjbayer
134+
* Document that comments aren't preserved for round trip (#1060) - Thanks @takluyver
135+
* Update sqlparser-derive to use `syn 2.0` (#1040) - Thanks @serprex
136+
137+
## [0.40.0] 2023-11-27
138+
139+
### Added
140+
* Add `{pre,post}_visit_query` to `Visitor` (#1044) - Thanks @jmhain
141+
* Support generated virtual columns with expression (#1051) - Thanks @takluyver
142+
* Support PostgreSQL `END` (#1035) - Thanks @tobyhede
143+
* Support `INSERT INTO ... DEFAULT VALUES ...` (#1036) - Thanks @CDThomas
144+
* Support `RELEASE` and `ROLLBACK TO SAVEPOINT` (#1045) - Thanks @CDThomas
145+
* Support `CONVERT` expressions (#1048) - Thanks @lovasoa
146+
* Support `GLOBAL` and `SESSION` parts in `SHOW VARIABLES` for mysql and generic - Thanks @emin100
147+
* Support snowflake `PIVOT` on derived table factors (#1027) - Thanks @lustefaniak
148+
* Support mssql json and xml extensions (#1043) - Thanks @lovasoa
149+
* Support for `MAX` as a character length (#1038) - Thanks @lovasoa
150+
* Support `IN ()` syntax of SQLite (#1028) - Thanks @alamb
151+
152+
### Fixed
153+
* Fix extra whitespace printed before `ON CONFLICT` (#1037) - Thanks @CDThomas
154+
155+
### Changed
156+
* Document round trip ability (#1052) - Thanks @alamb
157+
* Add PRQL to list of users (#1031) - Thanks @vanillajonathan
158+
159+
## [0.39.0] 2023-10-27
160+
161+
### Added
162+
* Support for `LATERAL FLATTEN` and similar (#1026) - Thanks @lustefaniak
163+
* Support BigQuery struct, array and bytes , int64, `float64` datatypes (#1003) - Thanks @iffyio
164+
* Support numbers as placeholders in Snowflake (e.g. `:1)` (#1001) - Thanks @yuval-illumex
165+
* Support date 'key' when using semi structured data (#1023) @yuval-illumex
166+
* Support IGNORE|RESPECT NULLs clause in window functions (#998) - Thanks @yuval-illumex
167+
* Support for single-quoted identifiers (#1021) - Thanks @lovasoa
168+
* Support multiple PARTITION statements in ALTER TABLE ADD statement (#1011) - Thanks @bitemyapp
169+
* Support "with" identifiers surrounded by backticks in GenericDialect (#1010) - Thanks @bitemyapp
170+
* Support INSERT IGNORE in MySql and GenericDialect (#1004) - Thanks @emin100
171+
* Support SQLite `pragma` statement (#969) - Thanks @marhoily
172+
* Support `position` as a column name (#1022) - Thanks @lustefaniak
173+
* Support `FILTER` in Functions (for `OVER`) clause (#1007) - Thanks @lovasoa
174+
* Support `SELECT * EXCEPT/REPLACE` syntax from ClickHouse (#1013) - Thanks @lustefaniak
175+
* Support subquery as function arg w/o parens in Snowflake dialect (#996) - Thanks @jmhain
176+
* Support `UNION DISTINCT BY NAME` syntax (#997) - Thanks @alexander-beedie
177+
* Support mysql `RLIKE` and `REGEXP` binary operators (#1017) - Thanks @lovasoa
178+
* Support bigquery `CAST AS x [STRING|DATE] FORMAT` syntax (#978) - Thanks @lustefaniak
179+
* Support Snowflake/BigQuery `TRIM`. (#975) - Thanks @zdenal
180+
* Support `CREATE [TEMPORARY|TEMP] VIEW [IF NOT EXISTS] `(#993) - Thanks @gabivlj
181+
* Support for `CREATE VIEW … WITH NO SCHEMA BINDING` Redshift (#979) - Thanks @lustefaniak
182+
* Support `UNPIVOT` and a fix for chained PIVOTs (#983) - @jmhain
183+
* Support for `LIMIT BY` (#977) - Thanks @lustefaniak
184+
* Support for mixed BigQuery table name quoting (#971) - Thanks @iffyio
185+
* Support `DELETE` with `ORDER BY` and `LIMIT` (MySQL) (#992) - Thanks @ulrichsg
186+
* Support `EXTRACT` for `DAYOFWEEK`, `DAYOFYEAR`, `ISOWEEK`, `TIME` (#980) - Thanks @lustefaniak
187+
* Support `ATTACH DATABASE` (#989) - Thanks @lovasoa
188+
189+
### Fixed
190+
* Fix handling of `/~%` in Snowflake stage name (#1009) - Thanks @lustefaniak
191+
* Fix column `COLLATE` not displayed (#1012) - Thanks @lustefaniak
192+
* Fix for clippy 1.73 (#995) - Thanks @alamb
193+
194+
### Changed
195+
* Test to ensure `+ - * / %` binary operators work the same in all dialects (#1025) - Thanks @lustefaniak
196+
* Improve documentation on Parser::consume_token and friends (#994) - Thanks @alamb
197+
* Test that regexp can be used as an identifier in postgres (#1018) - Thanks @lovasoa
198+
* Add docstrings for Dialects, update README (#1016) - Thanks @alamb
199+
* Add JumpWire to users in README (#990) - Thanks @hexedpackets
200+
* Add tests for clickhouse: `tokenize == as Token::DoubleEq` (#981)- Thanks @lustefaniak
201+
202+
## [0.38.0] 2023-09-21
203+
204+
### Added
205+
206+
* Support `==`operator for Sqlite (#970) - Thanks @marhoily
207+
* Support mysql `PARTITION` to table selection (#959) - Thanks @chunshao90
208+
* Support `UNNEST` as a table factor for PostgreSQL (#968) @hexedpackets
209+
* Support MySQL `UNIQUE KEY` syntax (#962) - Thanks @artorias1024
210+
* Support` `GROUP BY ALL` (#964) - @berkaysynnada
211+
* Support multiple actions in one ALTER TABLE statement (#960) - Thanks @ForbesLindesay
212+
* Add `--sqlite param` to CLI (#956) - Thanks @ddol
213+
214+
### Fixed
215+
* Fix Rust 1.72 clippy lints (#957) - Thanks @alamb
216+
217+
### Changed
218+
* Add missing token loc in parse err msg (#965) - Thanks @ding-young
219+
* Change how `ANY` and `ALL` expressions are represented in AST (#963) - Thanks @SeanTroyUWO
220+
* Show location info in parse errors (#958) - Thanks @MartinNowak
221+
* Update release documentation (#954) - Thanks @alamb
222+
* Break test and coverage test into separate jobs (#949) - Thanks @alamb
223+
224+
225+
## [0.37.0] 2023-08-22
226+
227+
### Added
228+
* Support `FOR SYSTEM_TIME AS OF` table time travel clause support, `visit_table_factor` to Visitor (#951) - Thanks @gruuya
229+
* Support MySQL `auto_increment` offset in table definition (#950) - Thanks @ehoeve
230+
* Test for mssql table name in square brackets (#952) - Thanks @lovasoa
231+
* Support additional Postgres `CREATE INDEX` syntax (#943) - Thanks @ForbesLindesay
232+
* Support `ALTER ROLE` syntax of PostgreSQL and MS SQL Server (#942) - Thanks @r4ntix
233+
* Support table-level comments (#946) - Thanks @ehoeve
234+
* Support `DROP TEMPORARY TABLE`, MySQL syntax (#916) - Thanks @liadgiladi
235+
* Support posgres type alias (#933) - Thanks @Kikkon
236+
237+
### Fixed
238+
* Clarify the value of the special flag (#948) - Thanks @alamb
239+
* Fix `SUBSTRING` from/to argument construction for mssql (#947) - Thanks @jmaness
240+
* Fix: use Rust idiomatic capitalization for newly added DataType enums (#939) - Thanks @Kikkon
241+
* Fix `BEGIN TRANSACTION` being serialized as `START TRANSACTION` (#935) - Thanks @lovasoa
242+
* Fix parsing of datetime functions without parenthesis (#930) - Thanks @lovasoa
243+
11244
## [0.36.1] 2023-07-19
12245

13246
### Fixed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "sqlparser"
33
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011"
4-
version = "0.36.1"
4+
version = "0.45.0"
55
authors = ["Andy Grove <[email protected]>"]
66
homepage = "https://github.com/sqlparser-rs/sqlparser-rs"
77
documentation = "https://docs.rs/sqlparser/"
@@ -34,7 +34,7 @@ serde = { version = "1.0", features = ["derive"], optional = true }
3434
# of dev-dependencies because of
3535
# https://github.com/rust-lang/cargo/issues/1596
3636
serde_json = { version = "1.0", optional = true }
37-
sqlparser_derive = { version = "0.1.1", path = "derive", optional = true }
37+
sqlparser_derive = { version = "0.2.0", path = "derive", optional = true }
3838

3939
[dev-dependencies]
4040
simple_logger = "4.0"

0 commit comments

Comments
 (0)