Skip to content

Commit 96ec48f

Browse files
authored
Merge branch 'sqlparser-rs:main' into main
2 parents 04c72be + 7282ce2 commit 96ec48f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+15191
-3270
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Prepare Rust Builder
19+
description: 'Prepare Rust Build Environment'
20+
inputs:
21+
rust-version:
22+
description: 'version of rust to install (e.g. stable)'
23+
required: true
24+
default: 'stable'
25+
targets:
26+
description: 'The toolchain targets to add, comma-separated'
27+
default: ''
28+
29+
runs:
30+
using: "composite"
31+
steps:
32+
- name: Setup Rust Toolchain
33+
shell: bash
34+
run: |
35+
echo "Installing ${{ inputs.rust-version }}"
36+
if [ -n "${{ inputs.targets}}" ]; then
37+
rustup toolchain install ${{ inputs.rust-version }} -t ${{ inputs.targets }}
38+
else
39+
rustup toolchain install ${{ inputs.rust-version }}
40+
fi
41+
rustup default ${{ inputs.rust-version }}
42+
rustup component add rustfmt clippy

.github/workflows/rust.yml

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,49 @@ jobs:
77
codestyle:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Set up Rust
11-
uses: hecrj/setup-rust-action@v1
10+
- uses: actions/checkout@v4
11+
- name: Setup Rust Toolchain
12+
uses: ./.github/actions/setup-builder
1213
with:
13-
components: rustfmt
1414
# Note that `nightly` is required for `license_template_path`, as
1515
# it's an unstable feature.
1616
rust-version: nightly
17-
- uses: actions/checkout@v2
1817
- run: cargo +nightly fmt -- --check --config-path <(echo 'license_template_path = "HEADER"')
1918

2019
lint:
2120
runs-on: ubuntu-latest
2221
steps:
23-
- name: Set up Rust
24-
uses: hecrj/setup-rust-action@v1
25-
with:
26-
components: clippy
27-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
23+
- name: Setup Rust Toolchain
24+
uses: ./.github/actions/setup-builder
2825
- run: cargo clippy --all-targets --all-features -- -D warnings
2926

3027
compile:
3128
runs-on: ubuntu-latest
3229
steps:
33-
- name: Set up Rust
34-
uses: hecrj/setup-rust-action@v1
35-
- uses: actions/checkout@master
30+
- uses: actions/checkout@v4
31+
- name: Setup Rust Toolchain
32+
uses: ./.github/actions/setup-builder
3633
- run: cargo check --all-targets --all-features
3734

3835
docs:
3936
runs-on: ubuntu-latest
4037
env:
4138
RUSTDOCFLAGS: "-Dwarnings"
4239
steps:
43-
- name: Set up Rust
44-
uses: hecrj/setup-rust-action@v1
45-
- uses: actions/checkout@master
40+
- uses: actions/checkout@v4
41+
- name: Setup Rust Toolchain
42+
uses: ./.github/actions/setup-builder
4643
- run: cargo doc --document-private-items --no-deps --workspace --all-features
4744

4845
compile-no-std:
4946
runs-on: ubuntu-latest
5047
steps:
51-
- name: Set up Rust
52-
uses: hecrj/setup-rust-action@v1
48+
- uses: actions/checkout@v4
49+
- name: Setup Rust Toolchain
50+
uses: ./.github/actions/setup-builder
5351
with:
5452
targets: 'thumbv6m-none-eabi'
55-
- uses: actions/checkout@master
5653
- run: cargo check --no-default-features --target thumbv6m-none-eabi
5754

5855
test:
@@ -61,8 +58,10 @@ jobs:
6158
rust: [stable, beta, nightly]
6259
runs-on: ubuntu-latest
6360
steps:
64-
- name: Setup Rust
65-
uses: hecrj/setup-rust-action@v1
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
- name: Setup Rust Toolchain
64+
uses: ./.github/actions/setup-builder
6665
with:
6766
rust-version: ${{ matrix.rust }}
6867
- name: Install Tarpaulin
@@ -71,16 +70,16 @@ jobs:
7170
crate: cargo-tarpaulin
7271
version: 0.14.2
7372
use-tool-cache: true
74-
- name: Checkout
75-
uses: actions/checkout@v2
7673
- name: Test
7774
run: cargo test --all-features
7875

7976
test-coverage:
8077
runs-on: ubuntu-latest
8178
steps:
82-
- name: Setup Rust
83-
uses: hecrj/setup-rust-action@v1
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
- name: Setup Rust Toolchain
82+
uses: ./.github/actions/setup-builder
8483
with:
8584
rust-version: stable
8685
- name: Install Tarpaulin
@@ -89,8 +88,6 @@ jobs:
8988
crate: cargo-tarpaulin
9089
version: 0.14.2
9190
use-tool-cache: true
92-
- name: Checkout
93-
uses: actions/checkout@v2
9491
- name: Coverage
9592
run: cargo tarpaulin -o Lcov --output-dir ./coverage
9693
- name: Coveralls
@@ -103,9 +100,9 @@ jobs:
103100
runs-on: ubuntu-latest
104101
needs: [test]
105102
steps:
106-
- name: Set up Rust
107-
uses: hecrj/setup-rust-action@v1
108-
- uses: actions/checkout@v2
103+
- uses: actions/checkout@v4
104+
- name: Setup Rust Toolchain
105+
uses: ./.github/actions/setup-builder
109106
- name: Publish
110107
shell: bash
111108
run: |

.github/workflows/stale.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: "Close stale PRs"
19+
on:
20+
schedule:
21+
- cron: "30 1 * * *"
22+
23+
jobs:
24+
close-stale-prs:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
issues: write
28+
pull-requests: write
29+
steps:
30+
- uses: actions/stale@v9
31+
with:
32+
stale-pr-message: "Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days."
33+
days-before-pr-stale: 60
34+
days-before-pr-close: 7
35+
# do not close stale issues
36+
days-before-issue-stale: -1
37+
days-before-issue-close: -1
38+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ Cargo.lock
1616
.vscode
1717

1818
*.swp
19+
20+
.DS_store

CHANGELOG.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,166 @@ 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.50.0] 2024-08-15
14+
Again, huge props to @iffyio @jmhain and @lovasoa for their help reviewing and merging PRs 🙏.
15+
Without them this project would not be possible.
16+
17+
Reminder: are in the process of moving sqlparser to governed as part of the Apache
18+
DataFusion project: https://github.com/sqlparser-rs/sqlparser-rs/issues/1294
19+
20+
# Fixed
21+
* Clippy 1.80 warnings (#1357) - Thanks @lovasoa
22+
23+
# Added
24+
* Support `STRUCT` and list of structs for DuckDB dialect (#1372) - Thanks @jayzhan211
25+
* Support custom lexical precedence in PostgreSQL dialect (#1379) - Thanks @samuelcolvin
26+
* Support `FREEZE|UNFREEZE PARTITION` syntax for ClickHouse (#1380) - Thanks @git-hulk
27+
* Support scale in `CEIL` and `FLOOR` functions (#1377) - Thanks @seve-martinez
28+
* Support `CREATE TRIGGER` and `DROP TRIGGER` statements (#1352) - Thanks @LucaCappelletti94
29+
* Support `EXTRACT` syntax for snowflake (#1374) - Thanks @seve-martinez
30+
* Support `ATTACH` / `DETACH PARTITION` for ClickHouse (#1362) - Thanks @git-hulk
31+
* Support Dialect level precedence, update Postgres Dialect to match Postgres (#1360) - Thanks @samuelcolvin
32+
* Support parsing empty map literal syntax for DuckDB and Generic dialects (#1361) - Thanks @goldmedal
33+
* Support `SETTINGS` clause for ClickHouse table-valued functions (#1358) - Thanks @Jesse-Bakker
34+
* Support `OPTIMIZE TABLE` statement for ClickHouse (#1359) - Thanks @git-hulk
35+
* Support `ON CLUSTER` in `ALTER TABLE` for ClickHouse (#1342) - Thanks @git-hulk
36+
* Support `GLOBAL` keyword before the join operator (#1353) - Thanks @git-hulk
37+
* Support postgres String Constants with Unicode Escapes (#1355) - Thanks @lovasoa
38+
* Support position with normal function call syntax for Snowflake (#1341) - Thanks @jmhain
39+
* Support `TABLE` keyword in `DESC|DESCRIBE|EXPLAIN TABLE` statement (#1351) - Thanks @git-hulk
40+
41+
# Changed
42+
* Only require `DESCRIBE TABLE` for Snowflake and ClickHouse dialect (#1386) - Thanks @ alamb
43+
* Rename (unreleased) `get_next_precedence_full` to `get_next_precedence_default` (#1378) - Thanks @samuelcolvin
44+
* Use local GitHub Action to replace setup-rust-action (#1371) - Thanks @git-hulk
45+
* Simplify arrow_cast tests (#1367) - Thanks @alamb
46+
* Update version of GitHub Actions (#1363) - Thanks @git-hulk
47+
* Make `Parser::maybe_parse` pub (#1364) - Thanks @Jesse-Bakker
48+
* Improve comments on 1Dialect` (#1366) - Thanks @alamb
49+
50+
51+
## [0.49.0] 2024-07-23
52+
As always, huge props to @iffyio @jmhain and @lovasoa for their help reviewing and merging PRs!
53+
54+
We are in the process of moving sqlparser to governed as part of the Apache
55+
DataFusion project: https://github.com/sqlparser-rs/sqlparser-rs/issues/1294
56+
57+
### Fixed
58+
* Fix quoted identifier regression edge-case with "from" in SELECT (#1346) - Thanks @alexander-beedie
59+
* Fix `AS` query clause should be after the create table options (#1339) - Thanks @git-hulk
60+
61+
### Added
62+
63+
* Support `MATERIALIZED`/`ALIAS`/`EPHERMERAL` default column options for ClickHouse (#1348) - Thanks @git-hulk
64+
* Support `()` as the `GROUP BY` nothing (#1347) - Thanks @git-hulk
65+
* Support Map literal syntax for DuckDB and Generic (#1344) - Thanks @goldmedal
66+
* Support subquery expression in `SET` expressions (#1343) - Thanks @iffyio
67+
* Support `WITH FILL` for ClickHouse (#1330) - Thanks @nickpresta
68+
* Support `PARTITION BY` for PostgreSQL in `CREATE TABLE` statement (#1338) - Thanks @git-hulk
69+
* Support of table function `WITH ORDINALITY` modifier for Postgres (#1337) - Thanks @git-hulk
70+
71+
72+
## [0.48.0] 2024-07-09
73+
74+
Huge shout out to @iffyio @jmhain and @lovasoa for their help reviewing and merging PRs!
75+
76+
### Fixed
77+
* Fix CI error message in CI (#1333) - Thanks @alamb
78+
* Fix typo in sqlparser-derive README (#1310) - Thanks @leoyvens
79+
* Re-enable trailing commas in DCL (#1318) - Thanks @MohamedAbdeen21
80+
* Fix a few typos in comment lines (#1316) - Thanks @git-hulk
81+
* Fix Snowflake `SELECT * wildcard REPLACE ... RENAME` order (#1321) - Thanks @alexander-beedie
82+
* Allow semi-colon at the end of UNCACHE statement (#1320) - Thanks @LorrensP-2158466
83+
* Return errors, not panic, when integers fail to parse in `AUTO_INCREMENT` and `TOP` (#1305) - Thanks @eejbyfeldt
84+
85+
### Added
86+
* Support `OWNER TO` clause in Postgres (#1314) - Thanks @gainings
87+
* Support `FORMAT` clause for ClickHouse (#1335) - Thanks @git-hulk
88+
* Support `DROP PROCEDURE` statement (#1324) - Thanks @LorrensP-2158466
89+
* Support `PREWHERE` condition for ClickHouse dialect (#1328) - Thanks @git-hulk
90+
* Support `SETTINGS` pairs for ClickHouse dialect (#1327) - Thanks @git-hulk
91+
* Support `GROUP BY WITH MODIFIER` for ClickHouse dialect (#1323) - Thanks @git-hulk
92+
* Support DuckDB Union datatype (#1322) - Thanks @gstvg
93+
* Support parametric arguments to `FUNCTION` for ClickHouse dialect (#1315) - Thanks @git-hulk
94+
* Support `TO` in `CREATE VIEW` clause for Clickhouse (#1313) - Thanks @Bidaya0
95+
* Support `UPDATE` statements that contain tuple assignments (#1317) - Thanks @lovasoa
96+
* Support `BY NAME quantifier across all set ops (#1309) - Thanks @alexander-beedie
97+
* Support SnowFlake exclusive `CREATE TABLE` options (#1233) - Thanks @balliegojr
98+
* Support ClickHouse `CREATE TABLE` with primary key and parametrised table engine (#1289) - Thanks @7phs
99+
* Support custom operators in Postgres (#1302) - Thanks @lovasoa
100+
* Support ClickHouse data types (#1285) - Thanks @7phs
101+
102+
### Changed
103+
* Add stale PR github workflow (#1331) - Thanks @alamb
104+
* Refine docs (#1326) - Thanks @emilsivervik
105+
* Improve error messages with additional colons (#1319) - Thanks @LorrensP-2158466
106+
* Move Display fmt to struct for `CreateIndex` (#1307) - Thanks @philipcristiano
107+
* Enhancing Trailing Comma Option (#1212) - Thanks @MohamedAbdeen21
108+
* Encapsulate `CreateTable`, `CreateIndex` into specific structs (#1291) - Thanks @philipcristiano
109+
110+
## [0.47.0] 2024-06-01
111+
112+
### Fixed
113+
* Re-support Postgres array slice syntax (#1290) - Thanks @jmhain
114+
* Fix DoubleColon cast skipping AT TIME ZONE #1266 (#1267) - Thanks @dmitrybugakov
115+
* Fix for values as table name in Databricks and generic (#1278) - Thanks @jmhain
116+
117+
### Added
118+
* Support `ASOF` joins in Snowflake (#1288) - Thanks @jmhain
119+
* Support `CREATE VIEW` with fields and data types ClickHouse (#1292) - Thanks @7phs
120+
* Support view comments for Snowflake (#1287) - Thanks @bombsimon
121+
* Support dynamic pivot in Snowflake (#1280) - Thanks @jmhain
122+
* Support `CREATE FUNCTION` for BigQuery, generalize AST (#1253) - Thanks @iffyio
123+
* Support expression in `AT TIME ZONE` and fix precedence (#1272) - Thanks @jmhain
124+
* Support `IGNORE/RESPECT NULLS` inside function argument list for Databricks (#1263) - Thanks @jmhain
125+
* Support `SELECT * EXCEPT` Databricks (#1261) - Thanks @jmhain
126+
* Support triple quoted strings (#1262) - Thanks @iffyio
127+
* Support array indexing for duckdb (#1265) - Thanks @JichaoS
128+
* Support multiple SET variables (#1252) - Thanks @iffyio
129+
* Support `ANY_VALUE` `HAVING` clause (#1258) in BigQuery - Thanks @jmhain
130+
* Support keywords as field names in BigQuery struct syntax (#1254) - Thanks @iffyio
131+
* Support `GROUP_CONCAT()` in MySQL (#1256) - Thanks @jmhain
132+
* Support lambda functions in Databricks (#1257) - Thanks @jmhain
133+
* Add const generic peek_tokens method to parser (#1255) - Thanks @jmhain
134+
135+
136+
## [0.46.0] 2024-05-03
137+
138+
### Changed
139+
* Consolidate representation of function calls, remove `AggregateExpressionWithFilter`, `ArraySubquery`, `ListAgg` and `ArrayAgg` (#1247) - Thanks jmhain
140+
* Extended dialect trait to support numeric prefixed identifiers (#1188) - Thanks @groobyming
141+
* Update simple_logger requirement from 4.0 to 5.0 (#1246) - Thanks @dependabot
142+
* Improve parsing of JSON accesses on Postgres and Snowflake (#1215) - Thanks @jmhain
143+
* Encapsulate Insert and Delete into specific structs (#1224) - Thanks @tisonkun
144+
* Preserve double colon casts (and simplify cast representations) (#1221) - Thanks @jmhain
145+
146+
### Fixed
147+
* Fix redundant brackets in Hive/Snowflake/Redshift (#1229) - Thanks @yuval-illumex
148+
149+
### Added
150+
* Support values without parens in Snowflake and DataBricks (#1249) - Thanks @HiranmayaGundu
151+
* Support WINDOW clause after QUALIFY when parsing (#1248) - Thanks @iffyio
152+
* Support `DECLARE` parsing for mssql (#1235) - Thanks @devanbenz
153+
* Support `?`-based jsonb operators in Postgres (#1242) - THanks @ReppCodes
154+
* Support Struct datatype parsing for GenericDialect (#1241) - Thanks @duongcongtoai
155+
* Support BigQuery window function null treatment (#1239) - Thanks @iffyio
156+
* Support extend pivot operator - Thanks @iffyio
157+
* Support Databricks SQL dialect (#1220) - Thanks @jmhain
158+
* Support for MSSQL CONVERT styles (#1219) - Thanks @iffyio
159+
* Support window clause using named window in BigQuery (#1237) - Thanks @iffyio
160+
* Support for CONNECT BY (#1138) - Thanks @jmhain
161+
* Support object constants in Snowflake (#1223) - Thanks @jmhain
162+
* Support BigQuery MERGE syntax (#1217) - Thanks @iffyio
163+
* Support for MAX for NVARCHAR (#1232) - Thanks @ bombsimon
164+
* Support fixed size list types (#1231) - @@universalmind303
165+
* Support Snowflake MATCH_RECOGNIZE syntax (#1222) - Thanks @jmhain
166+
* Support quoted string backslash escaping (#1177) - Thanks @iffyio
167+
* Support Modify Column for MySQL dialect (#1216) - Thanks @KKould
168+
* Support `select * ilike` for snowflake (#1228) - Thanks @HiranmayaGundu
169+
* Support wildcard replace in duckdb and snowflake syntax (#1226) - Thanks @HiranmayaGundu
170+
171+
172+
13173
## [0.45.0] 2024-04-12
14174

15175
### 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.50.0"
55
authors = ["Andy Grove <andygrove73@gmail.com>"]
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

0 commit comments

Comments
 (0)