Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ jobs:
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
rust-version: nightly-2022-03-08
- uses: actions/checkout@v2
- run: cargo +nightly fmt -- --check --config-path <(echo 'license_template_path = "HEADER"')
- run: cargo fmt -- --check --config-path <(echo 'license_template_path = "HEADER"')

lint:
runs-on: ubuntu-latest
Expand All @@ -24,6 +22,7 @@ jobs:
uses: hecrj/setup-rust-action@v1
with:
components: clippy
rust-version: nightly-2022-03-08
- uses: actions/checkout@v2
- run: cargo clippy --all-targets --all-features -- -D warnings

Expand All @@ -42,13 +41,14 @@ jobs:
uses: hecrj/setup-rust-action@v1
with:
targets: 'thumbv6m-none-eabi'
rust-version: nightly-2022-03-08
- uses: actions/checkout@master
- run: cargo check --no-default-features --target thumbv6m-none-eabi

test:
strategy:
matrix:
rust: [stable, beta, nightly]
rust: [stable, beta, nightly, nightly-2022-03-08]
runs-on: ubuntu-latest
steps:
- name: Setup Rust
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
/target/
/sqlparser_bench/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
314 changes: 314 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
stable
nightly-2022-03-08
5 changes: 5 additions & 0 deletions src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2231,10 +2231,15 @@ pub struct Function {
// aggregate functions may specify eg `COUNT(DISTINCT x)`
pub distinct: bool,
pub special: bool,
// Redshift provides `APPROXIMATE` option for some functions, e.g. `COUNT`
pub approximate: bool,
}

impl fmt::Display for Function {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if self.approximate {
write!(f, "APPROXIMATE ")?;
}
if self.special {
write!(f, "{}", self.name)?;
} else {
Expand Down
1 change: 1 addition & 0 deletions src/keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ define_keywords!(
AND,
ANY,
APPLY,
APPROXIMATE,
ARE,
ARRAY,
ARRAY_AGG,
Expand Down
Loading