Commit graph

56 commits

Author SHA1 Message Date
Sergey Olontsev
50c605a471
Support for Map values in ClickHouse settings (#1896)
Some checks are pending
Rust / test (beta) (push) Waiting to run
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
2025-06-28 08:13:11 +02:00
Ifeanyi Ubah
5f2b5fe7be
Fix clippy lints on 1.88.0 (#1910) 2025-06-27 14:21:17 -04:00
Ophir LOJKINE
178a351812
Fix big performance issue in string serialization (#1848) 2025-05-13 11:36:27 -04:00
Ophir LOJKINE
c335c8883b
Store spans for Value expressions (#1738) 2025-02-25 07:33:57 +01:00
tomershaniii
8fc8082e9a
Extend Visitor trait for Value type (#1725) 2025-02-22 06:48:39 +01:00
Paul Grau
447142c6d0
Make TypedString preserve quote style (#1679) 2025-01-31 07:04:41 +01:00
Alexander Beedie
e9498d538a
Add support for IS [NOT] [form] NORMALIZED (#1655)
Co-authored-by: Alexander Beedie <alexander.beedie@adia.ae>
2025-01-17 10:59:47 +01:00
wugeer
62bcaa1c98
Support pluralized time units (#1630) 2025-01-08 18:28:20 +01:00
Ifeanyi Ubah
6291afb2c7
Fix clippy warnings on rust 1.83 (#1570) 2024-11-29 06:37:06 -05:00
Andrew Lamb
9934f3d931
Update to ASF header / add when missing (#1437) 2024-09-21 06:23:28 -04:00
Ophir LOJKINE
bc15f7b4ce
Support for postgres String Constants with Unicode Escapes (#1355) 2024-07-29 17:18:16 -04:00
Ifeanyi Ubah
036a4120b4
Support triple quoted strings (#1262) 2024-05-11 06:41:04 -04:00
Joey Hain
4bfa399919
Improve parsing of JSON accesses on Postgres and Snowflake (#1215)
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
2024-04-30 10:49:05 -04:00
Andrew Lamb
a0ed14ce02
Do not allocate in impl Display for DateTimeField (#1209) 2024-04-09 17:23:22 -04:00
Ifeanyi Ubah
127be97369
Support more DateTimeField variants (#1191) 2024-04-09 17:16:03 -04:00
Alexander Beedie
3ec337ec5f
Add "timezone_region" and "timezone_abbr" support for EXTRACT (and DATE_PART) (#1090) 2024-01-16 08:46:10 -05:00
Lukasz Stefaniak
e718ce6c42
bigquery: EXTRACT support For DAYOFWEEK, DAYOFYEAR, ISOWEEK, TIME (#980) 2023-10-02 07:23:25 -04:00
canalun
f98a2f9dca
feat: mysql no-escape mode (#870)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-07-19 16:36:52 -04:00
Andrew Lamb
4efe55dd8a
Remove most instances of #[cfg(feature(bigdecimal))] in tests (#910) 2023-07-17 14:19:51 -04:00
Y Togami
58de3c1222
feat: support raw string literal of BigQuery (#812)
* add tests

* feat: parse raw literal of bq

* merge double quoted & single quoted to raw string literal

* Update src/ast/value.rs

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-03-01 14:11:42 -05:00
Y Togami
0c0d088ec2
feat: support byte string literal in bq (#802)
* rebase

* review

* lint
2023-02-19 10:38:03 -05: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
Ophir LOJKINE
524b8a7e7b
Add a mutable visitor (#782)
* Add a mutable visitor

This adds the ability to mutate parsed sql queries.
Previously, only visitors taking an immutable reference to the visited structures were allowed.

* add utility functions for mutable visits

* bump version numbers
2023-01-02 06:48:20 -05:00
Andrew Lamb
b93d82dfca
Fix cargo docs / warnings and add CI check (#777)
* Fix all rustdoc links

* Add docs CI check

* workflow

* test error

* fix yml

* fix yml

* Revert "test error"

This reverts commit 96a40a88a3.

* fix

* more
2022-12-29 07:53:51 -05:00
Alex Vasilev
072ccc0d76
feat: dollar-quoted strings support (#772)
* feat: support dollar-quoted strings

* remove comment

* unused code

* removed debugging

* added tests

* fmt

* clippy

* updated tests
2022-12-29 07:52:17 -05:00
Raphael Taylor-Davies
dec3c2b818
Add derive based AST visitor (#765)
* Add derive based AST visitor

* Fix BigDecimal

* Fix no visitor feature

* Add test

* Rename visit_table to visit_relation

* Review feedback

* Add pre and post visit

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-12-28 10:07:12 -05:00
Wei-Ting Kuo
bda8268e56
add keyword NANOSECOND (#749) 2022-12-06 15:29:41 -05:00
Augusto Fotino
5e1d9f8d6e
Derive PartialOrd, Ord, and Copy whenever possible (#717)
This allow other projects to use our structures inside others that need
those.
2022-11-30 12:25:59 -05:00
yuval-illumex
93a050e5f0
Snowflake: Support semi-structured data (#693)
* Support parse json in snowflake

* MR Review

* Lint

* Try to fix right as value

* Fix tests

* Fix lint

* Add generic dialect

* Add support in key location
2022-11-02 12:05:35 -04:00
Sarah Yurick
f0646c8c1a
add Date keyword (#691) 2022-10-31 15:20:57 -04:00
AugustoFKL
a3194ddd52
Create table builder structure (#659)
* Create table builder structure

* Adding comments and examples and adjusting file structure
2022-10-07 16:57:10 -04:00
Sarah Yurick
cb397d19f9
Support CEIL(expr TO DateTimeField) and FLOOR(expr TO DateTimeField) (#635)
* support ceil/floor to datetime

* Update mod.rs

* Update parser.rs

* murphys law

* Update sqlparser_common.rs

* possible fix?

* remove question mark

* ceil to floor

* Update mod.rs

* Apply suggestions from code review

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

* refactor into parse_ceil_floor_expr

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-10-06 15:21:25 -04:00
Sarah Yurick
d87408bdaf
Parse MILLENNIUM (#633)
* add unknown, is not true/false/unknown

* millennium
2022-09-28 16:26:29 -04:00
ding-young
3ac1bb5b80
Move Value::Interval to Expr::Interval (#609)
* refactor(value): convert Value::Interval to Expr::Interval

* test(sqlparser_common): modify test case

* refactor(parser): rename func parse_interval

* refactor(tests) rename parse_interval test func
2022-09-27 09:30:48 -04:00
Yoshi Togami
d981f70143
fix: Support expr instead of string for argument to interval (#517)
* fix: use expr instead of string in interval

* chore: resolve CI

Co-authored-by: togami2864 <yoshiaki.togami@plaid.co.jp>
2022-06-13 08:35:06 -04:00
Riccardo Azzolini
d19c6c323c
Fix escaping of trailing quote in quoted identifiers (#505)
* Generalize EscapeSingleQuoteString to arbitrary quote character

* Fix escaping of trailing quote in quoted identifiers

* Add new tests instead of modifying existing tests
2022-05-27 06:25:24 -04:00
Dmitry Patsura
2c0886d9fe
feat: Support escaped string literals (PostgreSQL) (#502)
* feat: Support escaped string literals (PostgreSQL)

Signed-off-by: Dmitry Patsura <talk@dmtry.me>

* lint

* escape ', \r, \t

* Update src/ast/value.rs

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

* Update src/tokenizer.rs

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

* test: two slashes

* remove dead code

* test: parsing error

* support generic dialect too (for DF)

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-05-25 14:42:14 -04:00
Yang Jiang
c688bbb4de
extract operator: add support for week keywords (#436) 2022-03-12 14:17:56 -05:00
Maciej Obuchowski
3af3ca07b6
extract operator: add support for Postgres keywords (#427)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
2022-03-07 10:03:28 -05:00
gamife
899f91b1f6
feat: add arg placeholder (#420)
Co-authored-by: gamife <gamife9886@gmail.com>
2022-02-17 07:55:21 -05:00
Jiseok CHOI
af1ac865b1
Add TrimWhereField for parse_trim_expr (#334)
* Remove Box from `trim_where`

* Add TrimWhereField for `parse_trim_expr`

* Add negative test case
2021-08-23 10:51:36 -04:00
Qinxuan Chen
5bc109a7ad
Support no_std (#332)
* Support `no_std`

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Fix typo

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-08-21 10:15:43 +02: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
Max Countryman
6cdd4a146d
Support general "typed string" literals (#187)
Fixes #168 by enabling `DATE` and other keywords to be used as
identifiers when not followed by a string literal.

A "typed string" is our term for generalized version of `DATE '...'`/`TIME '...'`/
`TIMESTAMP '...'` literals, represented as `TypedString { data_type, value }`
in the AST.

Unlike DATE/TIME/TIMESTAMP literals, this is a non-standard extension
supported by PostgreSQL at least.

This is a port of MaterializeInc/materialize#3146

Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
Co-authored-by: Nickolay Ponomarev <asqueella@gmail.com>
2020-06-12 00:04:43 +03:00
Taehoon Moon
2f1015339a
Add serde support to AST structs and enums (#196)
Apply serde to AST structs and enums to be serializable/deserializable.
serde support is optional, can be activated by feature named "serde".
2020-06-10 12:53:52 +03:00
Max Countryman
846c52f450
Allow omitting units after INTERVAL (#184)
Alter INTERVAL to support postgres syntax

This patch updates our INTERVAL implementation such that the Postgres
and Redshfit variation of the syntax is supported: namely that 'leading
field' is optional.

Fixes #177.
2020-06-10 09:32:13 +03:00
Nikhil Benesch
e9c5567b04
Merge pull request #135 from andygrove/show-columns
Support MySQL `SHOW COLUMNS` statement
2019-09-02 07:40:57 -04:00
Nikhil Benesch
a0aca824e8
Optionally parse numbers into BigDecimals
With `--features bigdecimal`, parse numbers into BigDecimals instead of
leaving them as strings.
2019-09-01 13:21:49 -04:00
Nikhil Benesch
b5621c0fe8
Don't lose precision when parsing decimal fractions
The SQL standard requires that numeric literals with a decimal point,
like 1.23, are represented exactly, up to some precision. That means
that parsing these literals into f64s is invalid, as it is impossible
to represent many decimal numbers exactly in binary floating point (for
example, 0.3).

This commit parses all numeric literals into a new `Value` variant
`Number(String)`, removing the old `Long(u64)` and `Double(f64)`
variants. This is slightly less convenient for downstream consumers, but
far more flexible, as numbers that do not fit into a u64 and f64 are now
representable.
2019-09-01 13:21:30 -04:00