Skip to content

Commit

Permalink
pull changes from upstream (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhain authored Apr 30, 2024
2 parents 9889b24 + 0ee3431 commit fd6ad77
Show file tree
Hide file tree
Showing 37 changed files with 5,272 additions and 2,143 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,37 @@ changes that break via addition as "Added".
## [Unreleased]
Check https://github.com/sqlparser-rs/sqlparser-rs/commits/main for undocumented changes.

## [0.45.0] 2024-04-12

### Added
* Support `DateTimeField` variants: `CUSTOM` and `WEEK(MONDAY)` (#1191) - Thanks @iffyio
* Support for arbitrary expr in `MapAccessSyntax` (#1179) - Thanks @iffyio
* Support unquoted hyphen in table/view declaration for BigQuery (#1178) - Thanks @iffyio
* Support `CREATE/DROP SECRET` for duckdb dialect (#1208) - Thanks @JichaoS
* Support MySQL `UNIQUE` table constraint (#1164) - Thanks @Nikita-str
* Support tailing commas on Snowflake. (#1205) - Thanks @yassun7010
* Support `[FIRST | AFTER column_name]` in `ALTER TABLE` for MySQL (#1180) - Thanks @xring
* Support inline comment with hash syntax for BigQuery (#1192) - Thanks @iffyio
* Support named windows in OVER (window_definition) clause (#1166) - Thanks @Nikita-str
* Support PARALLEL ... and for ..ON NULL INPUT ... to CREATE FUNCTION` (#1202) - Thanks @dimfeld
* Support DuckDB functions named arguments with assignment operator (#1195) - Thanks @alamb
* Support DuckDB struct literal syntax (#1194) - Thanks @gstvg
* Support `$$` in generic dialect ... (#1185)- Thanks @milenkovicm
* Support row_alias and col_aliases in `INSERT` statement for MySQL and Generic dialects (#1136) - Thanks @emin100

### Fixed
* Fix dollar quoted string tokenizer (#1193) - Thanks @ZacJW
* Do not allocate in `impl Display` for `DateTimeField` (#1209) - Thanks @alamb
* Fix parse `COPY INTO` stage names without parens for SnowFlake (#1187) - Thanks @mobuchowski
* Solve stack overflow on RecursionLimitExceeded on debug builds (#1171) - Thanks @Nikita-str
* Fix parsing of equality binary operator in function argument (#1182) - Thanks @jmhain
* Fix some comments (#1184) - Thanks @sunxunle

### Changed
* Cleanup `CREATE FUNCTION` tests (#1203) - Thanks @alamb
* Parse `SUBSTRING FROM` syntax in all dialects, reflect change in the AST (#1173) - Thanks @lovasoa
* Add identifier quote style to Dialect trait (#1170) - Thanks @backkem

## [0.44.0] 2024-03-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sqlparser"
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011"
version = "0.44.0"
version = "0.45.0"
authors = ["Andy Grove <[email protected]>"]
homepage = "https://github.com/sqlparser-rs/sqlparser-rs"
documentation = "https://docs.rs/sqlparser/"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ maintain this crate is limited. Please read the following sections carefully.
### New Syntax

The most commonly accepted PRs add support for or fix a bug in a feature in the
SQL standard, or a a popular RDBMS, such as Microsoft SQL
SQL standard, or a popular RDBMS, such as Microsoft SQL
Server or PostgreSQL, will likely be accepted after a brief
review. Any SQL feature that is dialect specific should be parsed by *both* the relevant [`Dialect`]
as well as [`GenericDialect`].
Expand Down
13 changes: 6 additions & 7 deletions src/ast/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum DataType {
/// Variable-length character type e.g. VARCHAR(10)
Varchar(Option<CharacterLength>),
/// Variable-length character type e.g. NVARCHAR(10)
Nvarchar(Option<u64>),
Nvarchar(Option<CharacterLength>),
/// Uuid type
Uuid,
/// Large character object with optional length e.g. CHARACTER LARGE OBJECT, CHARACTER LARGE OBJECT(1000), [standard]
Expand Down Expand Up @@ -238,9 +238,7 @@ impl fmt::Display for DataType {

DataType::CharVarying(size) => format_character_string_type(f, "CHAR VARYING", size),
DataType::Varchar(size) => format_character_string_type(f, "VARCHAR", size),
DataType::Nvarchar(size) => {
format_type_with_optional_length(f, "NVARCHAR", size, false)
}
DataType::Nvarchar(size) => format_character_string_type(f, "NVARCHAR", size),
DataType::Uuid => write!(f, "UUID"),
DataType::CharacterLargeObject(size) => {
format_type_with_optional_length(f, "CHARACTER LARGE OBJECT", size, false)
Expand Down Expand Up @@ -349,7 +347,8 @@ impl fmt::Display for DataType {
DataType::Bytea => write!(f, "BYTEA"),
DataType::Array(ty) => match ty {
ArrayElemTypeDef::None => write!(f, "ARRAY"),
ArrayElemTypeDef::SquareBracket(t) => write!(f, "{t}[]"),
ArrayElemTypeDef::SquareBracket(t, None) => write!(f, "{t}[]"),
ArrayElemTypeDef::SquareBracket(t, Some(size)) => write!(f, "{t}[{size}]"),
ArrayElemTypeDef::AngleBracket(t) => write!(f, "ARRAY<{t}>"),
},
DataType::Custom(ty, modifiers) => {
Expand Down Expand Up @@ -592,6 +591,6 @@ pub enum ArrayElemTypeDef {
None,
/// `ARRAY<INT>`
AngleBracket(Box<DataType>),
/// `[]INT`
SquareBracket(Box<DataType>),
/// `INT[]` or `INT[2]`
SquareBracket(Box<DataType>, Option<u64>),
}
Loading

0 comments on commit fd6ad77

Please sign in to comment.