Skip to content

Commit 25c2715

Browse files
authored
merge changes from v0.47.0 (#26)
2 parents b0c7673 + 1f0359b commit 25c2715

32 files changed

+5166
-1724
lines changed

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,70 @@ 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+
14+
## [0.47.0] 2024-06-01
15+
16+
### Fixed
17+
* Re-support Postgres array slice syntax (#1290) - Thanks @jmhain
18+
* Fix DoubleColon cast skipping AT TIME ZONE #1266 (#1267) - Thanks @dmitrybugakov
19+
* Fix for values as table name in Databricks and generic (#1278) - Thanks @jmhain
20+
21+
### Added
22+
* Support `ASOF` joins in Snowflake (#1288) - Thanks @jmhain
23+
* Support `CREATE VIEW` with fields and data types ClickHouse (#1292) - Thanks @7phs
24+
* Support view comments for Snowflake (#1287) - Thanks @bombsimon
25+
* Support dynamic pivot in Snowflake (#1280) - Thanks @jmhain
26+
* Support `CREATE FUNCTION` for BigQuery, generalize AST (#1253) - Thanks @iffyio
27+
* Support expression in `AT TIME ZONE` and fix precedence (#1272) - Thanks @jmhain
28+
* Support `IGNORE/RESPECT NULLS` inside function argument list for Databricks (#1263) - Thanks @jmhain
29+
* Support `SELECT * EXCEPT` Databricks (#1261) - Thanks @jmhain
30+
* Support triple quoted strings (#1262) - Thanks @iffyio
31+
* Support array indexing for duckdb (#1265) - Thanks @JichaoS
32+
* Support multiple SET variables (#1252) - Thanks @iffyio
33+
* Support `ANY_VALUE` `HAVING` clause (#1258) in BigQuery - Thanks @jmhain
34+
* Support keywords as field names in BigQuery struct syntax (#1254) - Thanks @iffyio
35+
* Support `GROUP_CONCAT()` in MySQL (#1256) - Thanks @jmhain
36+
* Support lambda functions in Databricks (#1257) - Thanks @jmhain
37+
* Add const generic peek_tokens method to parser (#1255) - Thanks @jmhain
38+
39+
40+
## [0.46.0] 2024-05-03
41+
42+
### Changed
43+
* Consolidate representation of function calls, remove `AggregateExpressionWithFilter`, `ArraySubquery`, `ListAgg` and `ArrayAgg` (#1247) - Thanks jmhain
44+
* Extended dialect trait to support numeric prefixed identifiers (#1188) - Thanks @groobyming
45+
* Update simple_logger requirement from 4.0 to 5.0 (#1246) - Thanks @dependabot
46+
* Improve parsing of JSON accesses on Postgres and Snowflake (#1215) - Thanks @jmhain
47+
* Encapsulate Insert and Delete into specific structs (#1224) - Thanks @tisonkun
48+
* Preserve double colon casts (and simplify cast representations) (#1221) - Thanks @jmhain
49+
50+
### Fixed
51+
* Fix redundant brackets in Hive/Snowflake/Redshift (#1229) - Thanks @yuval-illumex
52+
53+
### Added
54+
* Support values without parens in Snowflake and DataBricks (#1249) - Thanks @HiranmayaGundu
55+
* Support WINDOW clause after QUALIFY when parsing (#1248) - Thanks @iffyio
56+
* Support `DECLARE` parsing for mssql (#1235) - Thanks @devanbenz
57+
* Support `?`-based jsonb operators in Postgres (#1242) - THanks @ReppCodes
58+
* Support Struct datatype parsing for GenericDialect (#1241) - Thanks @duongcongtoai
59+
* Support BigQuery window function null treatment (#1239) - Thanks @iffyio
60+
* Support extend pivot operator - Thanks @iffyio
61+
* Support Databricks SQL dialect (#1220) - Thanks @jmhain
62+
* Support for MSSQL CONVERT styles (#1219) - Thanks @iffyio
63+
* Support window clause using named window in BigQuery (#1237) - Thanks @iffyio
64+
* Support for CONNECT BY (#1138) - Thanks @jmhain
65+
* Support object constants in Snowflake (#1223) - Thanks @jmhain
66+
* Support BigQuery MERGE syntax (#1217) - Thanks @iffyio
67+
* Support for MAX for NVARCHAR (#1232) - Thanks @ bombsimon
68+
* Support fixed size list types (#1231) - @@universalmind303
69+
* Support Snowflake MATCH_RECOGNIZE syntax (#1222) - Thanks @jmhain
70+
* Support quoted string backslash escaping (#1177) - Thanks @iffyio
71+
* Support Modify Column for MySQL dialect (#1216) - Thanks @KKould
72+
* Support `select * ilike` for snowflake (#1228) - Thanks @HiranmayaGundu
73+
* Support wildcard replace in duckdb and snowflake syntax (#1226) - Thanks @HiranmayaGundu
74+
75+
76+
1377
## [0.45.0] 2024-04-12
1478

1579
### Added

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.45.0"
4+
version = "0.47.0"
55
authors = ["Andy Grove <[email protected]>"]
66
homepage = "https://github.com/sqlparser-rs/sqlparser-rs"
77
documentation = "https://docs.rs/sqlparser/"
@@ -37,7 +37,7 @@ serde_json = { version = "1.0", optional = true }
3737
sqlparser_derive = { version = "0.2.0", path = "derive", optional = true }
3838

3939
[dev-dependencies]
40-
simple_logger = "4.0"
40+
simple_logger = "5.0"
4141
matches = "0.1"
4242
pretty_assertions = "1"
4343

src/ast/ddl.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ impl fmt::Display for ColumnDef {
815815
///
816816
/// Syntax
817817
/// ```markdown
818-
/// <name> [OPTIONS(option, ...)]
818+
/// <name> [data_type][OPTIONS(option, ...)]
819819
///
820820
/// option: <name> = <value>
821821
/// ```
@@ -824,18 +824,23 @@ impl fmt::Display for ColumnDef {
824824
/// ```sql
825825
/// name
826826
/// age OPTIONS(description = "age column", tag = "prod")
827+
/// created_at DateTime64
827828
/// ```
828829
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
829830
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
830831
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
831832
pub struct ViewColumnDef {
832833
pub name: Ident,
834+
pub data_type: Option<DataType>,
833835
pub options: Option<Vec<SqlOption>>,
834836
}
835837

836838
impl fmt::Display for ViewColumnDef {
837839
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
838840
write!(f, "{}", self.name)?;
841+
if let Some(data_type) = self.data_type.as_ref() {
842+
write!(f, " {}", data_type)?;
843+
}
839844
if let Some(options) = self.options.as_ref() {
840845
write!(
841846
f,

0 commit comments

Comments
 (0)