Skip to content

Commit d1e08c9

Browse files
authored
Merge branch 'main' into dev (#5)
2 parents f631629 + fe2ef47 commit d1e08c9

Some content is hidden

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

69 files changed

+9373
-1454
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: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,45 @@ jobs:
77
codestyle:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Set up Rust
11-
uses: hecrj/setup-rust-action@v1
12-
with:
13-
components: rustfmt
14-
# Note that `nightly` is required for `license_template_path`, as
15-
# it's an unstable feature.
16-
rust-version: nightly
17-
- uses: actions/checkout@v2
18-
- run: cargo +nightly fmt -- --check --config-path <(echo 'license_template_path = "HEADER"')
10+
- uses: actions/checkout@v4
11+
- name: Setup Rust Toolchain
12+
uses: ./.github/actions/setup-builder
13+
- run: cargo fmt -- --check
1914

2015
lint:
2116
runs-on: ubuntu-latest
2217
steps:
23-
- name: Set up Rust
24-
uses: hecrj/setup-rust-action@v1
25-
with:
26-
components: clippy
27-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
19+
- name: Setup Rust Toolchain
20+
uses: ./.github/actions/setup-builder
2821
- run: cargo clippy --all-targets --all-features -- -D warnings
2922

3023
compile:
3124
runs-on: ubuntu-latest
3225
steps:
33-
- name: Set up Rust
34-
uses: hecrj/setup-rust-action@v1
35-
- uses: actions/checkout@master
26+
- uses: actions/checkout@v4
27+
- name: Setup Rust Toolchain
28+
uses: ./.github/actions/setup-builder
3629
- run: cargo check --all-targets --all-features
3730

3831
docs:
3932
runs-on: ubuntu-latest
4033
env:
4134
RUSTDOCFLAGS: "-Dwarnings"
4235
steps:
43-
- name: Set up Rust
44-
uses: hecrj/setup-rust-action@v1
45-
- uses: actions/checkout@master
36+
- uses: actions/checkout@v4
37+
- name: Setup Rust Toolchain
38+
uses: ./.github/actions/setup-builder
4639
- run: cargo doc --document-private-items --no-deps --workspace --all-features
4740

4841
compile-no-std:
4942
runs-on: ubuntu-latest
5043
steps:
51-
- name: Set up Rust
52-
uses: hecrj/setup-rust-action@v1
44+
- uses: actions/checkout@v4
45+
- name: Setup Rust Toolchain
46+
uses: ./.github/actions/setup-builder
5347
with:
5448
targets: 'thumbv6m-none-eabi'
55-
- uses: actions/checkout@master
5649
- run: cargo check --no-default-features --target thumbv6m-none-eabi
5750

5851
test:
@@ -61,8 +54,10 @@ jobs:
6154
rust: [stable, beta, nightly]
6255
runs-on: ubuntu-latest
6356
steps:
64-
- name: Setup Rust
65-
uses: hecrj/setup-rust-action@v1
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
- name: Setup Rust Toolchain
60+
uses: ./.github/actions/setup-builder
6661
with:
6762
rust-version: ${{ matrix.rust }}
6863
- name: Install Tarpaulin
@@ -71,16 +66,16 @@ jobs:
7166
crate: cargo-tarpaulin
7267
version: 0.14.2
7368
use-tool-cache: true
74-
- name: Checkout
75-
uses: actions/checkout@v2
7669
- name: Test
7770
run: cargo test --all-features
7871

7972
test-coverage:
8073
runs-on: ubuntu-latest
8174
steps:
82-
- name: Setup Rust
83-
uses: hecrj/setup-rust-action@v1
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
- name: Setup Rust Toolchain
78+
uses: ./.github/actions/setup-builder
8479
with:
8580
rust-version: stable
8681
- name: Install Tarpaulin
@@ -89,8 +84,6 @@ jobs:
8984
crate: cargo-tarpaulin
9085
version: 0.14.2
9186
use-tool-cache: true
92-
- name: Checkout
93-
uses: actions/checkout@v2
9487
- name: Coverage
9588
run: cargo tarpaulin -o Lcov --output-dir ./coverage
9689
- name: Coveralls
@@ -103,9 +96,9 @@ jobs:
10396
runs-on: ubuntu-latest
10497
needs: [test]
10598
steps:
106-
- name: Set up Rust
107-
uses: hecrj/setup-rust-action@v1
108-
- uses: actions/checkout@v2
99+
- uses: actions/checkout@v4
100+
- name: Setup Rust Toolchain
101+
uses: ./.github/actions/setup-builder
109102
- name: Publish
110103
shell: bash
111104
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: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
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+
120
# Changelog
221
All notable changes to this project will be documented in this file.
322

@@ -11,6 +30,133 @@ changes that break via addition as "Added".
1130
Check https://github.com/sqlparser-rs/sqlparser-rs/commits/main for undocumented changes.
1231

1332

33+
## [0.51.0] 2024-09-11
34+
As always, huge props to @iffyio @jmhain and @lovasoa for their help reviewing and merging PRs 🙏.
35+
Without them this project would not be possible.
36+
37+
Reminder: we are in the final phases of moving sqlparser-rs into the Apache
38+
DataFusion project: https://github.com/sqlparser-rs/sqlparser-rs/issues/1294
39+
40+
### Fixed
41+
* Fix Hive table comment should be after table column definitions (#1413) - Thanks @git-hulk
42+
* Fix stack overflow in `parse_subexpr` (#1410) - Thanks @eejbyfeldt
43+
* Fix `INTERVAL` parsing to support expressions and units via dialect (#1398) - Thanks @samuelcolvin
44+
* Fix identifiers starting with `$` should be regarded as a placeholder in SQLite (#1402) - Thanks @git-hulk
45+
46+
### Added
47+
* Support for MSSQL table options (#1414) - Thanks @bombsimon
48+
* Test showing how negative constants are parsed (#1421) - Thanks @alamb
49+
* Support databricks dialect to dialect_from_str (#1416) - Thanks @milenkovicmalamb
50+
* Support `DROP|CLEAR|MATERIALIZE PROJECTION` syntax for ClickHouse (#1417) - Thanks @git-hulk
51+
* Support postgres `TRUNCATE` syntax (#1406) - Thanks @tobyhede
52+
* Support `CREATE INDEX` with clause (#1389) - Thanks @lewiszlw
53+
* Support parsing `CLUSTERED BY` clause for Hive (#1397) - Thanks @git-hulk
54+
* Support different `USE` statement syntaxes (#1387) - Thanks @kacpermuda
55+
* Support `ADD PROJECTION` syntax for ClickHouse (#1390) - Thanks @git-hulk
56+
57+
### Changed
58+
* Implement common traits for OneOrManyWithParens (#1368) - Thanks @gstvg
59+
* Cleanup parse_statement (#1407) - Thanks @samuelcolvin
60+
* Allow `DateTimeField::Custom` with `EXTRACT` in Postgres (#1394) - Thanks @samuelcolvin
61+
62+
63+
## [0.50.0] 2024-08-15
64+
Again, huge props to @iffyio @jmhain and @lovasoa for their help reviewing and merging PRs 🙏.
65+
Without them this project would not be possible.
66+
67+
Reminder: are in the process of moving sqlparser to governed as part of the Apache
68+
DataFusion project: https://github.com/sqlparser-rs/sqlparser-rs/issues/1294
69+
70+
### Fixed
71+
* Clippy 1.80 warnings (#1357) - Thanks @lovasoa
72+
73+
### Added
74+
* Support `STRUCT` and list of structs for DuckDB dialect (#1372) - Thanks @jayzhan211
75+
* Support custom lexical precedence in PostgreSQL dialect (#1379) - Thanks @samuelcolvin
76+
* Support `FREEZE|UNFREEZE PARTITION` syntax for ClickHouse (#1380) - Thanks @git-hulk
77+
* Support scale in `CEIL` and `FLOOR` functions (#1377) - Thanks @seve-martinez
78+
* Support `CREATE TRIGGER` and `DROP TRIGGER` statements (#1352) - Thanks @LucaCappelletti94
79+
* Support `EXTRACT` syntax for snowflake (#1374) - Thanks @seve-martinez
80+
* Support `ATTACH` / `DETACH PARTITION` for ClickHouse (#1362) - Thanks @git-hulk
81+
* Support Dialect level precedence, update Postgres Dialect to match Postgres (#1360) - Thanks @samuelcolvin
82+
* Support parsing empty map literal syntax for DuckDB and Generic dialects (#1361) - Thanks @goldmedal
83+
* Support `SETTINGS` clause for ClickHouse table-valued functions (#1358) - Thanks @Jesse-Bakker
84+
* Support `OPTIMIZE TABLE` statement for ClickHouse (#1359) - Thanks @git-hulk
85+
* Support `ON CLUSTER` in `ALTER TABLE` for ClickHouse (#1342) - Thanks @git-hulk
86+
* Support `GLOBAL` keyword before the join operator (#1353) - Thanks @git-hulk
87+
* Support postgres String Constants with Unicode Escapes (#1355) - Thanks @lovasoa
88+
* Support position with normal function call syntax for Snowflake (#1341) - Thanks @jmhain
89+
* Support `TABLE` keyword in `DESC|DESCRIBE|EXPLAIN TABLE` statement (#1351) - Thanks @git-hulk
90+
91+
### Changed
92+
* Only require `DESCRIBE TABLE` for Snowflake and ClickHouse dialect (#1386) - Thanks @ alamb
93+
* Rename (unreleased) `get_next_precedence_full` to `get_next_precedence_default` (#1378) - Thanks @samuelcolvin
94+
* Use local GitHub Action to replace setup-rust-action (#1371) - Thanks @git-hulk
95+
* Simplify arrow_cast tests (#1367) - Thanks @alamb
96+
* Update version of GitHub Actions (#1363) - Thanks @git-hulk
97+
* Make `Parser::maybe_parse` pub (#1364) - Thanks @Jesse-Bakker
98+
* Improve comments on 1Dialect` (#1366) - Thanks @alamb
99+
100+
101+
## [0.49.0] 2024-07-23
102+
As always, huge props to @iffyio @jmhain and @lovasoa for their help reviewing and merging PRs!
103+
104+
We are in the process of moving sqlparser to governed as part of the Apache
105+
DataFusion project: https://github.com/sqlparser-rs/sqlparser-rs/issues/1294
106+
107+
### Fixed
108+
* Fix quoted identifier regression edge-case with "from" in SELECT (#1346) - Thanks @alexander-beedie
109+
* Fix `AS` query clause should be after the create table options (#1339) - Thanks @git-hulk
110+
111+
### Added
112+
113+
* Support `MATERIALIZED`/`ALIAS`/`EPHERMERAL` default column options for ClickHouse (#1348) - Thanks @git-hulk
114+
* Support `()` as the `GROUP BY` nothing (#1347) - Thanks @git-hulk
115+
* Support Map literal syntax for DuckDB and Generic (#1344) - Thanks @goldmedal
116+
* Support subquery expression in `SET` expressions (#1343) - Thanks @iffyio
117+
* Support `WITH FILL` for ClickHouse (#1330) - Thanks @nickpresta
118+
* Support `PARTITION BY` for PostgreSQL in `CREATE TABLE` statement (#1338) - Thanks @git-hulk
119+
* Support of table function `WITH ORDINALITY` modifier for Postgres (#1337) - Thanks @git-hulk
120+
121+
122+
## [0.48.0] 2024-07-09
123+
124+
Huge shout out to @iffyio @jmhain and @lovasoa for their help reviewing and merging PRs!
125+
126+
### Fixed
127+
* Fix CI error message in CI (#1333) - Thanks @alamb
128+
* Fix typo in sqlparser-derive README (#1310) - Thanks @leoyvens
129+
* Re-enable trailing commas in DCL (#1318) - Thanks @MohamedAbdeen21
130+
* Fix a few typos in comment lines (#1316) - Thanks @git-hulk
131+
* Fix Snowflake `SELECT * wildcard REPLACE ... RENAME` order (#1321) - Thanks @alexander-beedie
132+
* Allow semi-colon at the end of UNCACHE statement (#1320) - Thanks @LorrensP-2158466
133+
* Return errors, not panic, when integers fail to parse in `AUTO_INCREMENT` and `TOP` (#1305) - Thanks @eejbyfeldt
134+
135+
### Added
136+
* Support `OWNER TO` clause in Postgres (#1314) - Thanks @gainings
137+
* Support `FORMAT` clause for ClickHouse (#1335) - Thanks @git-hulk
138+
* Support `DROP PROCEDURE` statement (#1324) - Thanks @LorrensP-2158466
139+
* Support `PREWHERE` condition for ClickHouse dialect (#1328) - Thanks @git-hulk
140+
* Support `SETTINGS` pairs for ClickHouse dialect (#1327) - Thanks @git-hulk
141+
* Support `GROUP BY WITH MODIFIER` for ClickHouse dialect (#1323) - Thanks @git-hulk
142+
* Support DuckDB Union datatype (#1322) - Thanks @gstvg
143+
* Support parametric arguments to `FUNCTION` for ClickHouse dialect (#1315) - Thanks @git-hulk
144+
* Support `TO` in `CREATE VIEW` clause for Clickhouse (#1313) - Thanks @Bidaya0
145+
* Support `UPDATE` statements that contain tuple assignments (#1317) - Thanks @lovasoa
146+
* Support `BY NAME quantifier across all set ops (#1309) - Thanks @alexander-beedie
147+
* Support SnowFlake exclusive `CREATE TABLE` options (#1233) - Thanks @balliegojr
148+
* Support ClickHouse `CREATE TABLE` with primary key and parametrised table engine (#1289) - Thanks @7phs
149+
* Support custom operators in Postgres (#1302) - Thanks @lovasoa
150+
* Support ClickHouse data types (#1285) - Thanks @7phs
151+
152+
### Changed
153+
* Add stale PR github workflow (#1331) - Thanks @alamb
154+
* Refine docs (#1326) - Thanks @emilsivervik
155+
* Improve error messages with additional colons (#1319) - Thanks @LorrensP-2158466
156+
* Move Display fmt to struct for `CreateIndex` (#1307) - Thanks @philipcristiano
157+
* Enhancing Trailing Comma Option (#1212) - Thanks @MohamedAbdeen21
158+
* Encapsulate `CreateTable`, `CreateIndex` into specific structs (#1291) - Thanks @philipcristiano
159+
14160
## [0.47.0] 2024-06-01
15161

16162
### Fixed

Cargo.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
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+
118
[package]
219
name = "sqlparser"
320
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011"
4-
version = "0.47.0"
21+
version = "0.51.0"
522
authors = ["Andy Grove <[email protected]>"]
623
homepage = "https://github.com/sqlparser-rs/sqlparser-rs"
724
documentation = "https://docs.rs/sqlparser/"

0 commit comments

Comments
 (0)