Skip to content

Commit d76527b

Browse files
serprexemin100tobyhedetakluyveralamb
authored
Update v45 (#34)
* Support Mysql `REPLACE` statement and `PRIORITY` clause of `INSERT` (#1072) * Support MySQL `FLUSH` statement (#1076) * Add support for ENABLE and DISABLE on ALTER TABLE for pg (#1077) Signed-off-by: Toby Hede <[email protected]> * Support SQLite column definitions with no type (#1075) * Support for pg ADD GENERATED in ALTER COLUMN statements (#1079) Signed-off-by: Toby Hede <[email protected]> * Adds support for pg CREATE EXTENSION (#1078) * Bump version of sqlparser-derive to 0.2.2 (#1083) * Add support for PostgreSQL Insert table aliases (#1069) (#1084) * Add support for PostgreSQL `^@` starts-with operator (#1091) * Add support for `JSONB` datatype (#1089) * Add "timezone_region" and "timezone_abbr" support for `EXTRACT` (and `DATE_PART`) (#1090) * Allow string values in pragma commands (#1101) Co-authored-by: Michael Ionov <[email protected]> * Add APIs to reuse token buffers in `Tokenizer` (#1094) * Add Postgres operators for the LIKE expression variants (#1096) * Add support for BigQuery table and view options (#1061) * Error on dangling `NO` in `CREATE SEQUENCE` options (#1104) * Support for unquoted hyphenated identifiers on bigquery (#1109) * ISSUE-1088: Fix array_agg wildcard behavior (#1093) Co-authored-by: Andrew Repp <[email protected]> * Add `Qrlew` as a user in README.md (#1107) * Add support for constraint characteristics clause (#1099) * Replace `AtomicUsize` with `Cell<usize>` in the recursion counter (#1098) * Use `Option<Expr>` for Min and Max vals in Seq Opts, fix alter col seq display (#1106) * Fix :start and :end json accesses on snowflake (#1110) * Update CHANGELOG.md for `0.42.0` release (#1111) * chore: Release sqlparser version 0.42.0 * chore: Release sqlparser version 0.43.0 * Fix changelog about version 0.43.0 (#1113) * chore: Release sqlparser version 0.43.1 * feat: add mysql show status statement (#1119) Co-authored-by: Michael Ionov <[email protected]> * BigQuery: Parse optional `DELETE FROM` statement (#1120) * Add support for UPDATE FROM for SQLite (further to #694) (#1117) * BigQuery: support of CREATE VIEW IF NOT EXISTS (#1118) * fix release instructions (#1115) * Fix clippy warning from rust 1.76 (#1130) * feat: support = operator in function args (#1128) Co-authored-by: Andrew Lamb <[email protected]> * feat: add duckdb "INSTALL" and "LOAD" (#1127) Co-authored-by: Andrew Lamb <[email protected]> * add support for `insert into ... select ... returning ...` (#1132) * accept JSON_TABLE both as an unquoted table name and a table-valued function (#1134) * Add ParadeDB to list of known users (#1142) * Fix panic for REPLACE (#1140) Co-authored-by: Joris Bayer <[email protected]> * Support for `(+)` outer join syntax (#1145) * Support`SELECT AS VALUE` and `SELECT AS STRUCT` for BigQuery (#1135) * Add `parse_keyword_with_tokens` for paring keyword and tokens combination (#1141) * Support `DECLARE` syntax for snowflake and bigquery (#1122) * ISSUE-1147: Add support for MATERIALIZED CTEs (#1148) Co-authored-by: Andrew Repp <[email protected]> Co-authored-by: Andrew Lamb <[email protected]> * Handle escape, unicode, and hex in `tokenize_escaped_single_quoted_string` (#1146) Co-authored-by: jasonnnli <[email protected]> Co-authored-by: Andrew Lamb <[email protected]> * Support `Unload` statement (#1150) Co-authored-by: Andrew Lamb <[email protected]> * Clean up nightly clippy lints (#1158) * set_tblproperties (#1151) * Support postgres style `CREATE FUNCTION` in `GenericDialect` (#1159) * Support `EXECUTE ... USING` for Postgres (#1153) * Support `serdeproperties` for CREATE TABLE with HIVE (#1152) Co-authored-by: Andrew Lamb <[email protected]> * adding delimited (#1155) * Support `ALTER TABLE ... SET LOCATION` (#1154) Co-authored-by: Andrew Lamb <[email protected]> * Support `EXPLAIN` / `DESCR` / `DESCRIBE` `[FORMATTED | EXTENDED]` (#1156) Co-authored-by: Andrew Lamb <[email protected]> * Version 0.44.0 CHANGELOG (#1161) * chore: Release sqlparser version 0.44.0 * Support `row_alias` and `col_aliases` in `INSERT` statement for mysql and generic dialects (#1136) * Add identifier quote style to `Dialect` trait (#1170) * Parse `SUBSTRING` `FROM` syntax in all dialects, reflect change in the AST (#1173) * Add support for $$ in generic dialect ... (#1185) * Add support for DuckDB struct literal syntax (#1194) Co-authored-by: Andrew Lamb <[email protected]> * Add support for DuckDB functions named arguments with assignment operator (#1195) Co-authored-by: Andrew Lamb <[email protected]> * Support `PARALLEL ... and for `..ON NULL INPUT ...` to `CREATE FUNCTION` (#1202) * chore: fix some comments (#1184) Signed-off-by: sunxunle <[email protected]> * Fix parsing of equality binop in function argument (#1182) * Cleanup CREATE FUNCTION tests (#1203) * solve `stack overflow` on `RecursionLimitExceeded` during debug building (#1171) Co-authored-by: Andrew Lamb <[email protected]> * Support named windows in `OVER (window_definition)` clause (#1166) Co-authored-by: Andrew Lamb <[email protected]> * BigQuery support inline comment with hash syntax (#1192) * Support `[FIRST | AFTER column_name]` support in `ALTER TABLE` for MySQL (#1180) * Fix parse `COPY INTO` stage names without parens for SnowFlake (#1187) Signed-off-by: Maciej Obuchowski <[email protected]> * feat: support tailing commas on snowflake dialect. (#1205) * Support MySQL `UNIQUE` table constraint (#1164) Co-authored-by: Andrew Lamb <[email protected]> * Support `CREATE/DROP SECRET` for duckdb dialect (#1208) Co-authored-by: Jichao Sun <[email protected]> * BigQuery: support unquoted hyphen in table/view declaration (#1178) * Support more `DateTimeField` variants (#1191) * Add support for arbitrary map access expr (#1179) * Do not allocate in `impl Display for DateTimeField` (#1209) * Fix dollar quoted string tokenizer (#1193) * CHANGELOG for 0.45.0 (#1213) * chore: Release sqlparser version 0.45.0 * fix tests, cargo fmt --------- Signed-off-by: Toby Hede <[email protected]> Signed-off-by: sunxunle <[email protected]> Signed-off-by: Maciej Obuchowski <[email protected]> Co-authored-by: Mehmet Emin KARAKAŞ <[email protected]> Co-authored-by: Toby Hede <[email protected]> Co-authored-by: Thomas Kluyver <[email protected]> Co-authored-by: Andrew Lamb <[email protected]> Co-authored-by: Boyd Johnson <[email protected]> Co-authored-by: Alexander Beedie <[email protected]> Co-authored-by: Michael Ionov <[email protected]> Co-authored-by: Michael Ionov <[email protected]> Co-authored-by: 0rphon <[email protected]> Co-authored-by: Marko Grujic <[email protected]> Co-authored-by: Ifeanyi Ubah <[email protected]> Co-authored-by: Quinn Sinclair <[email protected]> Co-authored-by: Joey Hain <[email protected]> Co-authored-by: Andrew Repp <[email protected]> Co-authored-by: Andrew Repp <[email protected]> Co-authored-by: Nicolas Grislain <[email protected]> Co-authored-by: Daniel Imfeld <[email protected]> Co-authored-by: wzzzzd <[email protected]> Co-authored-by: Greg Gaughan <[email protected]> Co-authored-by: Aleksei Piianin <[email protected]> Co-authored-by: universalmind303 <[email protected]> Co-authored-by: Ophir LOJKINE <[email protected]> Co-authored-by: Philippe Noël <[email protected]> Co-authored-by: Joris Bayer <[email protected]> Co-authored-by: Joris Bayer <[email protected]> Co-authored-by: Lukasz Stefaniak <[email protected]> Co-authored-by: Liang-Chi Hsieh <[email protected]> Co-authored-by: JasonLi <[email protected]> Co-authored-by: jasonnnli <[email protected]> Co-authored-by: Jonathan Lehto <[email protected]> Co-authored-by: Michiel De Backker <[email protected]> Co-authored-by: Marko Milenković <[email protected]> Co-authored-by: gstvg <[email protected]> Co-authored-by: sunxunle <[email protected]> Co-authored-by: Nikita-str <[email protected]> Co-authored-by: xring <[email protected]> Co-authored-by: Maciej Obuchowski <[email protected]> Co-authored-by: yassun7010 <[email protected]> Co-authored-by: Jichao Sun <[email protected]> Co-authored-by: ZacJW <[email protected]>
1 parent 1b4e3ce commit d76527b

35 files changed

+7763
-1088
lines changed

.tool-versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rust 1.73.0
1+
rust 1.75.0

CHANGELOG.md

+108-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,118 @@ 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
11118

12119
## [0.41.0] 2023-12-22
13120

Cargo.toml

+1-1
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.41.0"
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/"

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ $ cargo run --features json_example --example cli FILENAME.sql [--dialectname]
115115
## Users
116116

117117
This parser is currently being used by the [DataFusion] query engine,
118-
[LocustDB], [Ballista], [GlueSQL], [Opteryx], [PRQL], and [JumpWire].
118+
[LocustDB], [Ballista], [GlueSQL], [Opteryx], [PRQL], [Qrlew], [JumpWire], and [ParadeDB].
119119

120120
If your project is using sqlparser-rs feel free to make a PR to add it
121121
to this list.
@@ -151,7 +151,7 @@ maintain this crate is limited. Please read the following sections carefully.
151151
### New Syntax
152152

153153
The most commonly accepted PRs add support for or fix a bug in a feature in the
154-
SQL standard, or a a popular RDBMS, such as Microsoft SQL
154+
SQL standard, or a popular RDBMS, such as Microsoft SQL
155155
Server or PostgreSQL, will likely be accepted after a brief
156156
review. Any SQL feature that is dialect specific should be parsed by *both* the relevant [`Dialect`]
157157
as well as [`GenericDialect`].
@@ -211,7 +211,9 @@ licensed as above, without any additional terms or conditions.
211211
[GlueSQL]: https://github.com/gluesql/gluesql
212212
[Opteryx]: https://github.com/mabel-dev/opteryx
213213
[PRQL]: https://github.com/PRQL/prql
214+
[Qrlew]: https://github.com/Qrlew/qrlew
214215
[JumpWire]: https://github.com/extragoodlabs/jumpwire
216+
[ParadeDB]: https://github.com/paradedb/paradedb
215217
[Pratt Parser]: https://tdop.github.io/
216218
[sql-2016-grammar]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html
217219
[sql-standard]: https://en.wikipedia.org/wiki/ISO/IEC_9075

derive/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "sqlparser_derive"
33
description = "proc macro for sqlparser"
4-
version = "0.2.1"
4+
version = "0.2.2"
55
authors = ["sqlparser-rs authors"]
66
homepage = "https://github.com/sqlparser-rs/sqlparser-rs"
77
documentation = "https://docs.rs/sqlparser_derive/"

docs/releasing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ cargo install cargo-release
1919
```
2020
$ git fetch && git status
2121
On branch main
22-
Your branch is up to date with 'upstream/main'.
22+
Your branch is up to date with 'origin/main'.
2323
2424
nothing to commit, working tree clean
2525
```
@@ -28,7 +28,7 @@ $ cargo install cargo-release
2828
2. Using `cargo-release` we can publish a new release like so:
2929
3030
```
31-
$ cargo release minor --push-remote upstream
31+
$ cargo release minor --push-remote origin
3232
```
3333
3434
After verifying, you can rerun with `--execute` if all looks good.
@@ -39,7 +39,7 @@ $ cargo install cargo-release
3939
* Bump the minor part of the version in `Cargo.toml` (e.g. `0.7.1-alpha.0`
4040
-> `0.8.0`. You can use `patch` instead of `minor`, as appropriate).
4141
* Create a new tag (e.g. `v0.8.0`) locally
42-
* Push the new tag to the specified remote (`upstream` in the above
42+
* Push the new tag to the specified remote (`origin` in the above
4343
example), which will trigger a publishing process to crates.io as part of
4444
the [corresponding GitHub Action](https://github.com/sqlparser-rs/sqlparser-rs/blob/main/.github/workflows/rust.yml).
4545

src/ast/data_type.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ pub enum DataType {
198198
SnowflakeTimestamp,
199199
/// Interval
200200
Interval,
201-
/// JSON type used in BigQuery
201+
/// JSON type
202202
JSON,
203+
/// Binary JSON type
204+
JSONB,
203205
/// Regclass used in postgresql serial
204206
Regclass,
205207
/// Text
@@ -221,6 +223,10 @@ pub enum DataType {
221223
/// [hive]: https://docs.cloudera.com/cdw-runtime/cloud/impala-sql-reference/topics/impala-struct.html
222224
/// [bigquery]: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#struct_type
223225
Struct(Vec<StructField>),
226+
/// No type specified - only used with
227+
/// [`SQLiteDialect`](crate::dialect::SQLiteDialect), from statements such
228+
/// as `CREATE TABLE t1 (a)`.
229+
Unspecified,
224230
}
225231

226232
impl fmt::Display for DataType {
@@ -338,6 +344,7 @@ impl fmt::Display for DataType {
338344
}
339345
DataType::Interval => write!(f, "INTERVAL"),
340346
DataType::JSON => write!(f, "JSON"),
347+
DataType::JSONB => write!(f, "JSONB"),
341348
DataType::Regclass => write!(f, "REGCLASS"),
342349
DataType::Text => write!(f, "TEXT"),
343350
DataType::String(size) => format_type_with_optional_length(f, "STRING", size, false),
@@ -382,6 +389,7 @@ impl fmt::Display for DataType {
382389
}
383390
}
384391
DataType::SnowflakeTimestamp => write!(f, "TIMESTAMP_NTZ"),
392+
DataType::Unspecified => Ok(()),
385393
}
386394
}
387395
}

0 commit comments

Comments
 (0)