Skip to content

Commit 0ee3431

Browse files
committed
Merge remote-tracking branch 'upstream/main' into joey/update-4-29
Conflicts: src/parser/mod.rs tests/sqlparser_bigquery.rs tests/sqlparser_clickhouse.rs tests/sqlparser_snowflake.rs
2 parents 858c7fe + 0b5722a commit 0ee3431

37 files changed

Lines changed: 5460 additions & 1981 deletions

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,37 @@ changes that break via addition as "Added".
1010
## [Unreleased]
1111
Check https://github.com/sqlparser-rs/sqlparser-rs/commits/main for undocumented changes.
1212

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+
1344
## [0.44.0] 2024-03-02
1445

1546
### Added

Cargo.toml

Lines changed: 1 addition & 1 deletion
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.44.0"
4+
version = "0.45.0"
55
authors = ["Andy Grove <andygrove73@gmail.com>"]
66
homepage = "https://github.com/sqlparser-rs/sqlparser-rs"
77
documentation = "https://docs.rs/sqlparser/"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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`].

src/ast/data_type.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub enum DataType {
4040
/// Variable-length character type e.g. VARCHAR(10)
4141
Varchar(Option<CharacterLength>),
4242
/// Variable-length character type e.g. NVARCHAR(10)
43-
Nvarchar(Option<u64>),
43+
Nvarchar(Option<CharacterLength>),
4444
/// Uuid type
4545
Uuid,
4646
/// Large character object with optional length e.g. CHARACTER LARGE OBJECT, CHARACTER LARGE OBJECT(1000), [standard]
@@ -238,9 +238,7 @@ impl fmt::Display for DataType {
238238

239239
DataType::CharVarying(size) => format_character_string_type(f, "CHAR VARYING", size),
240240
DataType::Varchar(size) => format_character_string_type(f, "VARCHAR", size),
241-
DataType::Nvarchar(size) => {
242-
format_type_with_optional_length(f, "NVARCHAR", size, false)
243-
}
241+
DataType::Nvarchar(size) => format_character_string_type(f, "NVARCHAR", size),
244242
DataType::Uuid => write!(f, "UUID"),
245243
DataType::CharacterLargeObject(size) => {
246244
format_type_with_optional_length(f, "CHARACTER LARGE OBJECT", size, false)
@@ -349,7 +347,8 @@ impl fmt::Display for DataType {
349347
DataType::Bytea => write!(f, "BYTEA"),
350348
DataType::Array(ty) => match ty {
351349
ArrayElemTypeDef::None => write!(f, "ARRAY"),
352-
ArrayElemTypeDef::SquareBracket(t) => write!(f, "{t}[]"),
350+
ArrayElemTypeDef::SquareBracket(t, None) => write!(f, "{t}[]"),
351+
ArrayElemTypeDef::SquareBracket(t, Some(size)) => write!(f, "{t}[{size}]"),
353352
ArrayElemTypeDef::AngleBracket(t) => write!(f, "ARRAY<{t}>"),
354353
},
355354
DataType::Custom(ty, modifiers) => {
@@ -592,6 +591,6 @@ pub enum ArrayElemTypeDef {
592591
None,
593592
/// `ARRAY<INT>`
594593
AngleBracket(Box<DataType>),
595-
/// `[]INT`
596-
SquareBracket(Box<DataType>),
594+
/// `INT[]` or `INT[2]`
595+
SquareBracket(Box<DataType>, Option<u64>),
597596
}

0 commit comments

Comments
 (0)