forked from apache/datafusion-sqlparser-rs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: sync the wip-cst branch with the main branch
- Loading branch information
Showing
62 changed files
with
5,698 additions
and
1,163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: cargo | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: cargo | ||
directory: "/sqlparser_bench" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,78 @@ | ||
name: Rust | ||
|
||
on: [push] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
codestyle: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: rustfmt | ||
# Note that `nightly` is required for `license_template_path`, as | ||
# it's an unstable feature. | ||
rust-version: nightly | ||
- uses: actions/checkout@v2 | ||
- run: cargo +nightly fmt -- --check --config-path <(echo 'license_template_path = "HEADER"') | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
components: clippy | ||
- uses: actions/checkout@v2 | ||
- run: cargo clippy --all-targets --all-features -- -D warnings | ||
|
||
compile: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
- uses: actions/checkout@master | ||
- run: cargo check --all-targets --all-features | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
rust: [stable, beta, nightly] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup Rust | ||
run: | | ||
rustup toolchain install nightly --profile default | ||
rustup toolchain install stable | ||
rustup override set stable | ||
# Clippy must be run first, as its lints are only triggered during | ||
# compilation. Put another way: after a successful `cargo build`, `cargo | ||
# clippy` is guaranteed to produce no results. This bug is known upstream: | ||
# https://github.com/rust-lang/rust-clippy/issues/2604. | ||
# - name: Clippy | ||
# run: cargo clippy -- --all-targets --all-features -- -D warnings | ||
- name: Check formatting | ||
run: | | ||
cargo +nightly fmt -- --check --config-path <(echo 'license_template_path = "HEADER"') | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
- name: Run tests for all features | ||
run: cargo test --verbose -- all-features | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: ${{ matrix.rust }} | ||
- name: Install Tarpaulin | ||
uses: actions-rs/[email protected] | ||
with: | ||
crate: cargo-tarpaulin | ||
version: 0.14.2 | ||
use-tool-cache: true | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Test | ||
run: cargo test --all-features | ||
- name: Coverage | ||
if: matrix.rust == 'stable' | ||
run: cargo tarpaulin -o Lcov --output-dir ./coverage | ||
- name: Coveralls | ||
if: matrix.rust == 'stable' | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
publish-crate: | ||
if: startsWith(github.ref, 'refs/tags/v0') | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- name: Set up Rust | ||
uses: hecrj/setup-rust-action@v1 | ||
- uses: actions/checkout@v2 | ||
- name: Publish | ||
shell: bash | ||
run: | | ||
cargo publish --token ${{ secrets.CRATES_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
[package] | ||
name = "sqlparser" | ||
description = "Extensible SQL Lexer and Parser with support for ANSI SQL:2011" | ||
version = "0.5.1-alpha-0" | ||
version = "0.8.1-alpha.0" | ||
authors = ["Andy Grove <[email protected]>"] | ||
homepage = "https://github.com/andygrove/sqlparser-rs" | ||
homepage = "https://github.com/ballista-compute/sqlparser-rs" | ||
documentation = "https://docs.rs/sqlparser/" | ||
keywords = [ "ansi", "sql", "lexer", "parser" ] | ||
repository = "https://github.com/andygrove/sqlparser-rs" | ||
repository = "https://github.com/ballista-compute/sqlparser-rs" | ||
license = "Apache-2.0" | ||
include = [ | ||
"src/**/*.rs", | ||
|
@@ -19,15 +19,25 @@ name = "sqlparser" | |
path = "src/lib.rs" | ||
|
||
[features] | ||
cst = ["rowan"] # Retain a concrete synatax tree, available as `parser.syntax()` | ||
cst = ["rowan"] # Retain a concrete synatax tree, available as `parser.syntax()` | ||
json_example = ["serde_json", "serde"] # Enable JSON output in the `cli` example: | ||
|
||
[dependencies] | ||
bigdecimal = { version = "0.1.0", optional = true, features = ["serde"] } | ||
log = "0.4.5" | ||
bigdecimal = { version = "0.2", features = ["serde"], optional = true } | ||
log = "0.4" | ||
rowan = { version = "0.10.0", optional = true, features = ["serde1"] } | ||
serde = { version = "1.0.106", features = ["derive"] } | ||
serde_json = "1.0.52" | ||
serde = { version = "1.0", features = ["derive"], optional = true } | ||
# serde_json is only used in examples/cli, but we have to put it outside | ||
# of dev-dependencies because of | ||
# https://github.com/rust-lang/cargo/issues/1596 | ||
serde_json = { version = "1.0", optional = true } | ||
|
||
[dev-dependencies] | ||
simple_logger = "1.0.1" | ||
simple_logger = "1.9" | ||
matches = "0.1" | ||
|
||
[package.metadata.release] | ||
# Instruct `cargo release` to not run `cargo publish` locally: | ||
# https://github.com/sunng87/cargo-release/blob/master/docs/reference.md#config-fields | ||
# See docs/releasing.md for details. | ||
disable-publish = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Benchmarking | ||
|
||
Run `cargo bench` in the project `sqlparser_bench` execute the queries. | ||
It will report results using the `criterion` library to perform the benchmarking. | ||
|
||
The bench project lives in another crate, to avoid the negative impact on building the `sqlparser` crate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Releasing | ||
|
||
## Prerequisites | ||
Publishing to crates.io has been automated via GitHub Actions, so you will only | ||
need push access to the [ballista-compute GitHub repository](https://github.com/ballista-compute/sqlparser-rs) | ||
in order to publish a release. | ||
|
||
We use the [`cargo release`](https://github.com/sunng87/cargo-release) | ||
subcommand to ensure correct versioning. Install via: | ||
|
||
``` | ||
$ cargo install cargo-release | ||
``` | ||
|
||
## Process | ||
|
||
1. **Before releasing** ensure `CHANGELOG.md` is updated appropriately and that | ||
you have a clean checkout of the `main` branch of the sqlparser repository: | ||
``` | ||
$ git fetch && git status | ||
On branch main | ||
Your branch is up to date with 'upstream/main'. | ||
nothing to commit, working tree clean | ||
``` | ||
* If you have the time, check that the examples in the README are up to date. | ||
2. Using `cargo-release` we can publish a new release like so: | ||
``` | ||
$ cargo release minor --push-remote upstream | ||
``` | ||
You can add `--dry-run` to see what the command is going to do, | ||
or `--skip-push` to stop before actually publishing the release. | ||
`cargo release` will then: | ||
* Bump the minor part of the version in `Cargo.toml` (e.g. `0.7.1-alpha.0` | ||
-> `0.8.0`. You can use `patch` instead of `minor`, as appropriate). | ||
* Create a new tag (e.g. `v0.8.0`) locally | ||
* Push the new tag to the specified remote (`upstream` in the above | ||
example), which will trigger a publishing process to crates.io as part of | ||
the [corresponding GitHub Action](https://github.com/ballista-compute/sqlparser-rs/blob/main/.github/workflows/rust.yml). | ||
Note that credentials for authoring in this way are securely stored in | ||
the (GitHub) repo secrets as `CRATE_TOKEN`. | ||
* Bump the crate version again (to something like `0.8.1-alpha.0`) to | ||
indicate the start of new development cycle. | ||
3. Push the updates to the `main` branch upstream: | ||
``` | ||
$ git push upstream | ||
``` | ||
4. Check that the new version of the crate is available on crates.io: | ||
https://crates.io/crates/sqlparser | ||
Oops, something went wrong.