Commit graph

26 commits

Author SHA1 Message Date
Ifeanyi Ubah
5f2b5fe7be
Fix clippy lints on 1.88.0 (#1910) 2025-06-27 14:21:17 -04:00
Michael Victor Zink
a1150223af
Allow example CLI to read from stdin (#1536) 2024-11-22 14:06:42 -05:00
Andrew Lamb
9934f3d931
Update to ASF header / add when missing (#1437) 2024-09-21 06:23:28 -04:00
David Dolphin
4a2fa66b55
[cli] add --sqlite param (#956) 2023-08-25 12:06:25 -04:00
eitsupi
33b12acce7
feat: add DuckDB dialect (#878)
* feat: add DuckDB dialect

* formatting

* fix conflict

* support // in GenericDialect

* add DucDbDialect to all_dialects

* add comment from suggestion

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

* fix: support // in GenericDialect

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-05-18 14:57:29 -04:00
Brian Anglin
6b2b3f1f6c
Adds clickhouse to example (#849) 2023-04-12 15:04:46 -04:00
Y Togami
b31ede7733
chore: fix clippy error in ci (#803)
* chore: fix clippy error in ci

* chore: fix fmt
2023-02-17 13:24:50 -05:00
Yoshiyuki Komazaki
97a148aee4
Add BigQuery dialect (#490) 2022-05-10 10:25:27 -04:00
Maciej Skrzypkowski
7fc6361fe8
Add Redshift dialect, handle square brackets properly (#471)
* Redshift square bracket handling

We need to detect `[` or `"` for Redshift quotes around indentifier and at the same time exclude
treating JSON paths as indentifer

* RedshiftSqlDialect documentation update

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

* Renamed _chars to chars

* Fixed warnings

* Missing license

Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-05-04 11:11:00 -04:00
Andrew Lamb
82eaae1522
Implement some MySQL specific syntax and extend the UPDATE statement (#375)
* * implement the ON DUPLICATE KEY syntax for MySQL in an INSERT statement

* * add MySQL to the cli example
* remove the dialect check for the ON DUPLICATE KEY insert to support
  custom dialects and unwrap some missing results

* * use the Assignment DataType for the ON DUPLICATE KEY UPDATE

* * add support for table aliases in an UPDATE statement
* add support for JOINS in an UPDATE statement (for MySQL)

* * implement the MySQL ALTER TABLE CHANGE COLUMN syntax

* * fix the formatting of the else * rename the parse_identifiers_strict
  to parse_identifiers_non_keywords

* Parse SUBSTRING calls that are separated with a comma instead of
keywords

* Fix the linting errors

Co-authored-by: Piotr <piotr.morawski@nc-vision.com>
Co-authored-by: Piotr Morawski <contact@peter-morawski.de>
2021-12-10 14:46:11 -05:00
Qinxuan Chen
67e17b27f5
Make clippy happy (#330)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-08-19 23:02:15 +02:00
Stephen Carman
8a214f9919
Implement Hive QL Parsing (#235) 2021-02-04 12:53:20 -07:00
Daniël Heres
2f71324c33
Fix deprecated way of initializing SimpleLogger (#275)
* Use builder pattern instead as suggested
2020-09-07 09:34:27 +02:00
eyalleshem
f500a42e99
Add snowflake dialect (#259) 2020-08-12 04:55:22 +03:00
Taehoon Moon
a0f076acda
Make the cli example print JSON (#197)
...via the new json_example feature - to make it easier to try out the parser without coding.
2020-06-12 16:38:59 +03:00
Daniël Heres
d32df527e6
Accept &str in Parse::parse_sql (#182)
It is more generic to accept a `&str` than a `String` in an API,
and avoids having to convert a string to a `String` when not
needed, avoiding a copy.
2020-06-03 23:31:41 +03:00
Nickolay Ponomarev
40853fe412 Fix a recently implemented clippy lint
https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
"Import with single component use path such as `use cratename;`
is not necessary, and thus should be removed."
2020-05-10 21:16:25 +03:00
Nickolay Ponomarev
4ce0eb11ae Fix a new clippy lint (.nth(0)) to unbreak CI
"iter.next() is equivalent to iter.nth(0), as they both consume the
next element, but is more readable."

https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
2020-04-14 17:09:48 +03:00
Nikhil Benesch
ac555d7e86
Remove "SQL" prefix from types
The rationale here is the same as the last commit: since this crate
exclusively parses SQL, there's no need to restate that in every type
name. (The prefix seems to be an artifact of this crate's history as a
submodule of Datafusion, where it was useful to explicitly call out
which types were related to SQL parsing.)

This commit has the additional benefit of making all type names
consistent; over type we'd added some types which were not prefixed with
"SQL".
2019-06-25 13:11:11 -04:00
Nikhil Benesch
cf655ad1a6
Remove "sql" prefix from module names
Since this crate only deals with SQL parsing, the modules are understood
to refer to SQL and don't need to restate that explicitly.
2019-06-24 12:56:26 -04:00
Nikhil Benesch
e78cf0483e
Standardize license headers
Standardize the license header, removing the Grove Enterprise copyright
notice where it exists per #58. Also add a CI check to ensure that files
without license headers don't get merged.

Fix #58.
2019-06-04 10:54:12 -04:00
Nickolay Ponomarev
e6f5ff2926 [example-cli] Support parsing with different dialects 2019-06-02 13:48:14 +03:00
Nickolay Ponomarev
098d1c4a17 Enable clippy lints by default in RLS 2019-04-21 04:46:19 +03:00
Nickolay Ponomarev
c223eaf0aa Fix a bunch of trivial clippy lints 2019-04-21 04:46:19 +03:00
Nickolay Ponomarev
b12a19e197 Switch to the Rust 2018 edition
This requires Rust 1.31 (from last year) to build, but is otherwise
compatible with the 2015-edition code.
2019-04-21 04:41:11 +03:00
Nickolay Ponomarev
2e9da53ed3 Small CLI app that can be used to test parsing an external SQL file 2019-02-07 05:34:16 +03:00