|
| 1 | +<!-- |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +or more contributor license agreements. See the NOTICE file |
| 4 | +distributed with this work for additional information |
| 5 | +regarding copyright ownership. The ASF licenses this file |
| 6 | +to you under the Apache License, Version 2.0 (the |
| 7 | +"License"); you may not use this file except in compliance |
| 8 | +with the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | +Unless required by applicable law or agreed to in writing, |
| 13 | +software distributed under the License is distributed on an |
| 14 | +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +KIND, either express or implied. See the License for the |
| 16 | +specific language governing permissions and limitations |
| 17 | +under the License. |
| 18 | +--> |
| 19 | + |
| 20 | +# sqlparser-rs 0.55.0 Changelog |
| 21 | + |
| 22 | +This release consists of 55 commits from 25 contributors. See credits at the end of this changelog for more information. |
| 23 | + |
| 24 | +## Migrating usages of `Expr::Value` |
| 25 | + |
| 26 | +In v0.55 of sqlparser the `Expr::Value` enum variant contains a `ValueWithSpan` instead of a `Value`. Here is how to migrate. |
| 27 | + |
| 28 | +### When pattern matching |
| 29 | + |
| 30 | +```diff |
| 31 | +- Expr::Value(Value::SingleQuotedString(my_string)) => { ... } |
| 32 | ++ Expr::Value(ValueWithSpan{ value: Value::SingleQuotedString(my_string), span: _ }) => { ... } |
| 33 | +``` |
| 34 | + |
| 35 | +### When creating an `Expr` |
| 36 | + |
| 37 | +Use the new `Expr::value` method (notice the lowercase `v`), which will create a `ValueWithSpan` containing an empty span: |
| 38 | + |
| 39 | +```diff |
| 40 | +- Expr::Value(Value::SingleQuotedString(my_string)) |
| 41 | ++ Expr::value(Value::SingleQuotedString(my_string)) |
| 42 | +``` |
| 43 | + |
| 44 | +## Migrating usages of `ObjectName` |
| 45 | + |
| 46 | +In v0.55 of sqlparser, the `ObjectName` structure has been changed as shown below. Here is now to migrate. |
| 47 | + |
| 48 | +```diff |
| 49 | +- pub struct ObjectName(pub Vec<Ident>); |
| 50 | ++ pub struct ObjectName(pub Vec<ObjectNamePart>) |
| 51 | +``` |
| 52 | + |
| 53 | +### When constructing `ObjectName` |
| 54 | + |
| 55 | +Use the `From` impl: |
| 56 | + |
| 57 | +```diff |
| 58 | +- name: ObjectName(vec![Ident::new("f")]), |
| 59 | ++ name: ObjectName::from(vec![Ident::new("f")]), |
| 60 | +``` |
| 61 | + |
| 62 | +### Accessing Spans |
| 63 | + |
| 64 | +Use the `span()` function |
| 65 | + |
| 66 | +```diff |
| 67 | +- name.span |
| 68 | ++ name.span() |
| 69 | +``` |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +**Breaking changes:** |
| 74 | + |
| 75 | +- Enhance object name path segments [#1539](https://github.com/apache/datafusion-sqlparser-rs/pull/1539) (ayman-sigma) |
| 76 | +- Store spans for Value expressions [#1738](https://github.com/apache/datafusion-sqlparser-rs/pull/1738) (lovasoa) |
| 77 | + |
| 78 | +**Implemented enhancements:** |
| 79 | + |
| 80 | +- feat: adjust create and drop trigger for mysql dialect [#1734](https://github.com/apache/datafusion-sqlparser-rs/pull/1734) (invm) |
| 81 | + |
| 82 | +**Fixed bugs:** |
| 83 | + |
| 84 | +- fix: make `serde` feature no_std [#1730](https://github.com/apache/datafusion-sqlparser-rs/pull/1730) (iajoiner) |
| 85 | + |
| 86 | +**Other:** |
| 87 | + |
| 88 | +- Update rat_exclude_file.txt [#1670](https://github.com/apache/datafusion-sqlparser-rs/pull/1670) (alamb) |
| 89 | +- Add support for Snowflake account privileges [#1666](https://github.com/apache/datafusion-sqlparser-rs/pull/1666) (yoavcloud) |
| 90 | +- Add support for Create Iceberg Table statement for Snowflake parser [#1664](https://github.com/apache/datafusion-sqlparser-rs/pull/1664) (Vedin) |
| 91 | +- National strings: check if dialect supports backslash escape [#1672](https://github.com/apache/datafusion-sqlparser-rs/pull/1672) (hansott) |
| 92 | +- Only support escape literals for Postgres, Redshift and generic dialect [#1674](https://github.com/apache/datafusion-sqlparser-rs/pull/1674) (hansott) |
| 93 | +- BigQuery: Support trailing commas in column definitions list [#1682](https://github.com/apache/datafusion-sqlparser-rs/pull/1682) (iffyio) |
| 94 | +- Enable GROUP BY exp for Snowflake dialect [#1683](https://github.com/apache/datafusion-sqlparser-rs/pull/1683) (yoavcloud) |
| 95 | +- Add support for parsing empty dictionary expressions [#1684](https://github.com/apache/datafusion-sqlparser-rs/pull/1684) (yoavcloud) |
| 96 | +- Support multiple tables in `UPDATE FROM` clause [#1681](https://github.com/apache/datafusion-sqlparser-rs/pull/1681) (iffyio) |
| 97 | +- Add support for mysql table hints [#1675](https://github.com/apache/datafusion-sqlparser-rs/pull/1675) (AvivDavid-Satori) |
| 98 | +- BigQuery: Add support for select expr star [#1680](https://github.com/apache/datafusion-sqlparser-rs/pull/1680) (iffyio) |
| 99 | +- Support underscore separators in numbers for Clickhouse. Fixes #1659 [#1677](https://github.com/apache/datafusion-sqlparser-rs/pull/1677) (graup) |
| 100 | +- BigQuery: Fix column identifier reserved keywords list [#1678](https://github.com/apache/datafusion-sqlparser-rs/pull/1678) (iffyio) |
| 101 | +- Fix bug when parsing a Snowflake stage with `;` suffix [#1688](https://github.com/apache/datafusion-sqlparser-rs/pull/1688) (yoavcloud) |
| 102 | +- Allow plain JOIN without turning it into INNER [#1692](https://github.com/apache/datafusion-sqlparser-rs/pull/1692) (mvzink) |
| 103 | +- Fix DDL generation in case of an empty arguments function. [#1690](https://github.com/apache/datafusion-sqlparser-rs/pull/1690) (remysaissy) |
| 104 | +- Fix `CREATE FUNCTION` round trip for Hive dialect [#1693](https://github.com/apache/datafusion-sqlparser-rs/pull/1693) (iffyio) |
| 105 | +- Make numeric literal underscore test dialect agnostic [#1685](https://github.com/apache/datafusion-sqlparser-rs/pull/1685) (iffyio) |
| 106 | +- Extend lambda support for ClickHouse and DuckDB dialects [#1686](https://github.com/apache/datafusion-sqlparser-rs/pull/1686) (gstvg) |
| 107 | +- Make TypedString preserve quote style [#1679](https://github.com/apache/datafusion-sqlparser-rs/pull/1679) (graup) |
| 108 | +- Do not parse ASOF and MATCH_CONDITION as table factor aliases [#1698](https://github.com/apache/datafusion-sqlparser-rs/pull/1698) (yoavcloud) |
| 109 | +- Add support for GRANT on some common Snowflake objects [#1699](https://github.com/apache/datafusion-sqlparser-rs/pull/1699) (yoavcloud) |
| 110 | +- Add RETURNS TABLE() support for CREATE FUNCTION in Postgresql [#1687](https://github.com/apache/datafusion-sqlparser-rs/pull/1687) (remysaissy) |
| 111 | +- Add parsing for GRANT ROLE and GRANT DATABASE ROLE in Snowflake dialect [#1689](https://github.com/apache/datafusion-sqlparser-rs/pull/1689) (yoavcloud) |
| 112 | +- Add support for `CREATE/ALTER/DROP CONNECTOR` syntax [#1701](https://github.com/apache/datafusion-sqlparser-rs/pull/1701) (wugeer) |
| 113 | +- Parse Snowflake COPY INTO <location> [#1669](https://github.com/apache/datafusion-sqlparser-rs/pull/1669) (yoavcloud) |
| 114 | +- Require space after -- to start single line comment in MySQL [#1705](https://github.com/apache/datafusion-sqlparser-rs/pull/1705) (hansott) |
| 115 | +- Add suppport for Show Objects statement for the Snowflake parser [#1702](https://github.com/apache/datafusion-sqlparser-rs/pull/1702) (DanCodedThis) |
| 116 | +- Fix incorrect parsing of JsonAccess bracket notation after cast in Snowflake [#1708](https://github.com/apache/datafusion-sqlparser-rs/pull/1708) (yoavcloud) |
| 117 | +- Parse Postgres VARBIT datatype [#1703](https://github.com/apache/datafusion-sqlparser-rs/pull/1703) (mvzink) |
| 118 | +- Implement FROM-first selects [#1713](https://github.com/apache/datafusion-sqlparser-rs/pull/1713) (mitsuhiko) |
| 119 | +- Enable custom dialects to support `MATCH() AGAINST()` [#1719](https://github.com/apache/datafusion-sqlparser-rs/pull/1719) (joocer) |
| 120 | +- Support group by cube/rollup etc in BigQuery [#1720](https://github.com/apache/datafusion-sqlparser-rs/pull/1720) (Groennbeck) |
| 121 | +- Add support for MS Varbinary(MAX) (#1714) [#1715](https://github.com/apache/datafusion-sqlparser-rs/pull/1715) (TylerBrinks) |
| 122 | +- Add supports for Hive's `SELECT ... GROUP BY .. GROUPING SETS` syntax [#1653](https://github.com/apache/datafusion-sqlparser-rs/pull/1653) (wugeer) |
| 123 | +- Differentiate LEFT JOIN from LEFT OUTER JOIN [#1726](https://github.com/apache/datafusion-sqlparser-rs/pull/1726) (mvzink) |
| 124 | +- Add support for Postgres `ALTER TYPE` [#1727](https://github.com/apache/datafusion-sqlparser-rs/pull/1727) (jvatic) |
| 125 | +- Replace `Method` and `CompositeAccess` with `CompoundFieldAccess` [#1716](https://github.com/apache/datafusion-sqlparser-rs/pull/1716) (iffyio) |
| 126 | +- Add support for `EXECUTE IMMEDIATE` [#1717](https://github.com/apache/datafusion-sqlparser-rs/pull/1717) (iffyio) |
| 127 | +- Treat COLLATE like any other column option [#1731](https://github.com/apache/datafusion-sqlparser-rs/pull/1731) (mvzink) |
| 128 | +- Add support for PostgreSQL/Redshift geometric operators [#1723](https://github.com/apache/datafusion-sqlparser-rs/pull/1723) (benrsatori) |
| 129 | +- Implement SnowFlake ALTER SESSION [#1712](https://github.com/apache/datafusion-sqlparser-rs/pull/1712) (osipovartem) |
| 130 | +- Extend Visitor trait for Value type [#1725](https://github.com/apache/datafusion-sqlparser-rs/pull/1725) (tomershaniii) |
| 131 | +- Add support for `ORDER BY ALL` [#1724](https://github.com/apache/datafusion-sqlparser-rs/pull/1724) (PokIsemaine) |
| 132 | +- Parse casting to array using double colon operator in Redshift [#1737](https://github.com/apache/datafusion-sqlparser-rs/pull/1737) (yoavcloud) |
| 133 | +- Replace parallel condition/result vectors with single CaseWhen vector in Expr::Case. This fixes the iteration order when using the `Visitor` trait. Expressions are now visited in the same order as they appear in the sql source. [#1733](https://github.com/apache/datafusion-sqlparser-rs/pull/1733) (lovasoa) |
| 134 | +- BigQuery: Add support for `BEGIN` [#1718](https://github.com/apache/datafusion-sqlparser-rs/pull/1718) (iffyio) |
| 135 | +- Parse SIGNED INTEGER type in MySQL CAST [#1739](https://github.com/apache/datafusion-sqlparser-rs/pull/1739) (mvzink) |
| 136 | +- Parse MySQL ALTER TABLE ALGORITHM option [#1745](https://github.com/apache/datafusion-sqlparser-rs/pull/1745) (mvzink) |
| 137 | +- Random test cleanups use Expr::value [#1749](https://github.com/apache/datafusion-sqlparser-rs/pull/1749) (alamb) |
| 138 | +- Parse ALTER TABLE AUTO_INCREMENT operation for MySQL [#1748](https://github.com/apache/datafusion-sqlparser-rs/pull/1748) (mvzink) |
| 139 | + |
| 140 | +## Credits |
| 141 | + |
| 142 | +Thank you to everyone who contributed to this release. Here is a breakdown of commits (PRs merged) per contributor. |
| 143 | + |
| 144 | +``` |
| 145 | + 10 Yoav Cohen |
| 146 | + 9 Ifeanyi Ubah |
| 147 | + 7 Michael Victor Zink |
| 148 | + 3 Hans Ott |
| 149 | + 2 Andrew Lamb |
| 150 | + 2 Ophir LOJKINE |
| 151 | + 2 Paul Grau |
| 152 | + 2 Rémy SAISSY |
| 153 | + 2 wugeer |
| 154 | + 1 Armin Ronacher |
| 155 | + 1 Artem Osipov |
| 156 | + 1 AvivDavid-Satori |
| 157 | + 1 Ayman Elkfrawy |
| 158 | + 1 DanCodedThis |
| 159 | + 1 Denys Tsomenko |
| 160 | + 1 Emil |
| 161 | + 1 Ian Alexander Joiner |
| 162 | + 1 Jesse Stuart |
| 163 | + 1 Justin Joyce |
| 164 | + 1 Michael |
| 165 | + 1 SiLe Zhou |
| 166 | + 1 Tyler Brinks |
| 167 | + 1 benrsatori |
| 168 | + 1 gstvg |
| 169 | + 1 tomershaniii |
| 170 | +``` |
| 171 | + |
| 172 | +Thank you also to everyone who contributed in other ways such as filing issues, reviewing PRs, and providing feedback on this release. |
| 173 | + |
0 commit comments