Commit graph

845 commits

Author SHA1 Message Date
b41sh
80759a4deb support regex match 2021-08-13 19:50:14 +08:00
sundyli
e5991f3ae5
Support tinyint (#320)
* Support tinyint

* Add tests
2021-07-17 14:16:38 +02:00
Andrew Lamb
c5de1225e9
Update datafusion link in README (#319) 2021-06-30 07:50:09 +02:00
Chojan Shang
a12dd0e83a *: make clippy happy
Signed-off-by: Chojan Shang <psiace@outlook.com>
2021-06-25 03:43:11 +08:00
Daniël Heres
d8775e2815
Fix linting errors (#318)
* Fix linting error

* Fix linting errors
2021-06-22 07:49:25 +02:00
BohuTANG
56e50dccd4
[parser] Return error instead of panic (#316)
* [parser] return error instead of panic

* Fix clippy warning

* Fix cargo fmt warning
2021-06-22 07:05:43 +02:00
Chojan Shang
0c52491191 docs: fuzzing
Signed-off-by: Chojan Shang <psiace@outlook.com>
2021-06-03 14:10:15 +08:00
Chojan Shang
1e65984613 test: add fuzzer
Signed-off-by: Chojan Shang <psiace@outlook.com>
2021-06-03 14:00:16 +08:00
Max Countryman
35ef0eee38
Merge pull request #300 from maxcountryman/feature/ilike
provide ILIKE support
2021-03-22 07:46:12 -07:00
Max Countryman
a9e6f77d62 provide ILIKE support
This introduces support for ILIKE and NOT ILIKE. ILIKE is the
case-insensitive variant of LIKE. Systems such as Postgres, Redshift,
and Snowflake provide this variant.[1][2][3]

[1] https://www.postgresql.org/docs/7.3/functions-matching.html
[2] https://docs.aws.amazon.com/redshift/latest/dg/r_patternmatching_condition_like.html
[3] https://docs.snowflake.com/en/sql-reference/functions/ilike.html
2021-03-22 07:31:42 -07:00
Heres, Daniel
1e87ab8e22 (cargo-release) start next development iteration 0.9.1-alpha.0 2021-03-21 23:29:18 +01:00
Heres, Daniel
f52891d0da (cargo-release) version 0.9.0 2021-03-21 23:29:18 +01:00
Heres, Daniel
c2340d1821 Add release notes for 0.8.0 2021-03-21 23:28:22 +01:00
Mike Seddon
e6e37b47db
Implement TRY_CAST (#299)
Adds support for `TRY_CAST` and fixes a clippy error
2021-03-21 23:26:16 +01:00
Heres, Daniel
43fef23bc8 (cargo-release) start next development iteration 0.8.1-alpha.0 2021-02-09 21:31:27 +01:00
Heres, Daniel
34cd794cd3 (cargo-release) version 0.8.0 2021-02-09 21:31:27 +01:00
Heres, Daniel
a868ff6ebe Add release notes 2021-02-09 21:30:05 +01:00
zhangli-pear
add8991144
feat: support sqlite insert or statement (#281) 2021-02-09 21:04:54 +01:00
Francis Du
07342d5853
Support parsing multiple show variables. (#290)
* feat: support parsing multiple show variables.

* fix: fix fmt error
2021-02-09 21:03:49 +01:00
Daniël Heres
f40955ee82
Parse floats without leading number (#294)
* Parse floats without leading number

* Move period token test

* Comments

* Enable test
2021-02-08 08:11:01 +01:00
Daniël Heres
6f0b2dcd92
Implement SUBSTRING(col [FROM <expr>] [FOR <expr>]) syntax (#293) 2021-02-07 08:06:50 -07:00
Stephen Carman
8a214f9919
Implement Hive QL Parsing (#235) 2021-02-04 12:53:20 -07:00
joshwd36
17f8eb9c5a
Fix clippy lints (#287) 2021-01-07 18:30:12 +01:00
Heres, Daniel
200ed5ecfc (cargo-release) start next development iteration 0.7.1-alpha.0 2020-12-28 21:51:28 +01:00
Heres, Daniel
e11b80ecf9 (cargo-release) version 0.7.0 2020-12-28 21:51:28 +01:00
Heres, Daniel
97cd1c017d Release 0.7.0 instead 2020-12-28 21:48:07 +01:00
Heres, Daniel
9930bdff68 (cargo-release) start next development iteration 0.6.3-alpha.0 2020-12-28 20:35:22 +01:00
Heres, Daniel
26c281eaf7 (cargo-release) version 0.6.2 2020-12-28 20:35:21 +01:00
Heres, Daniel
d66294fab8 Add date 2020-12-28 20:32:11 +01:00
Heres, Daniel
e18e8dc674 Prepare 0.6.2 2020-12-28 20:31:14 +01:00
Daniël Heres
94ff46802c
Support ANALYZE TABLE syntax (#285)
* Support analyze table

* Cleanup
2020-12-28 10:08:32 -07:00
Dmitry Patsura
17f2930885
Introduce support for EXPLAIN [ANALYZE] [VERBOSE] <STATEMENT> syntax
Introduce support for EXPLAIN [ANALYZE] [VERBOSE] <STATEMENT> syntax
2020-12-28 12:22:03 +01:00
Nickolay Ponomarev
cbd3c6b1a1
Merge pull request #263 from ballista-compute/documentation/cargo-release-config
add a note about cargo release config
2020-10-13 10:03:51 +03:00
Nickolay Ponomarev
929fc6764f
Merge pull request #260 from eyalleshem/single_tables_in_parens
[snowflake] Support `FROM (table_name) alias`
2020-10-13 09:59:38 +03:00
Nickolay Ponomarev
ad72cda6b0 [snowflake] Support specifying an alias after FROM (table_factor)
Snowflake diverges from the standard and from most of the other
implementations by allowing extra parentheses not only around a join,
but around lone table names (e.g. `FROM (mytable [AS alias])`) and
around derived tables (e.g. `FROM ((SELECT ...)  [AS alias])`) as well.

Initially this was implemented in https://github.com/ballista-compute/sqlparser-rs/issues/154
by (ab)using `TableFactor::NestedJoin` to represent anything nested in
extra set of parens.

Afterwards we learned in https://github.com/ballista-compute/sqlparser-rs/issues/223
that in cases of such extraneous nesting Snowflake allows specifying the
alias both inside and outside parens, but not both - consider:

    FROM (table_factor AS inner_alias) AS outer_alias

We've considered implementing this by changing `TableFactor::NestedJoin`
to a `TableFactor::Nested { inner: TableWithJoins, alias:
Option<TableAlias> }`, but that seemed too generic, as no known dialect
supports duplicate aliases, as shown above, nor naming nested joins
`(foo NATURAL JOIN bar) alias`. So we decided on making a smaller change
(with no modifications to the AST), that is also more appropriate to the
contributors to the Snowflake dialect:


1) Revert #154 by rejecting `FROM (table or derived table)` in most dialects.

2) For `dialect_of!(self is SnowflakeDialect | GenericDialect)` parse
and strip the extraneous parentheses, e.g.

   `(mytable) AS alias` -> `(mytable AS alias)`


Co-authored-by: Eyal Leshem <eyal@satoricyber.com>
2020-10-13 09:51:02 +03:00
Nickolay Ponomarev
d9e044aabb Extend one_statement_parses_to to also test parsing canonical SQL
It was an omission of the original implementation.
2020-10-12 06:52:39 +03:00
Nickolay Ponomarev
4128dfe1db Introduce tests/test_utils/mod.rs and use it consistently
To share helper macros between various tests/* we added a new module
(tests/macros/mod.rs). This made the prologue to be used in tests quite
long and a little weird:
```
#[macro_use]
#[path = "macros/mod.rs"]
mod macros;
use sqlparser::test_utils::*;
```

This simplifies it to:
```
#[macro_use]
mod test_utils;
use test_utils::*;
```
- and switches all existing tests to the new prologue simultaneously...

...while fixing a few other inconsistencies and adding a few comments
about the way `test_utils` work.
2020-10-12 06:52:00 +03:00
rhanqtl
9f772f03b0
Add support for Recursive CTEs (#278)
i.e. `WITH RECURSIVE ... AS ( ... ) SELECT` - see https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#with-clause

Fixes #277
2020-10-11 09:43:51 +03:00
Nickolay Ponomarev
99fb633221 Move existing SF tests to sqlparser_snowflake.rs
Co-authored-by: Eyal Leshem <eyal@satoricyber.com>
2020-10-05 08:42:26 +03:00
Nickolay Ponomarev
54be3912a9 Update CHANGELOG 2020-10-05 04:32:46 +03:00
Nickolay Ponomarev
7dc5d4c35e Follow-up to #275: Bump simple_logger version in Cargo.toml
SimpleLogger is private in v1.6. Bumping its version in Cargo.toml makes
`git pull && carg test` use the new version in an existing checkout
(with an existing Cargo.lock file referencing the old version)
2020-10-05 04:32:46 +03:00
Alex Dukhno
1ac208307c
Support IF NOT EXISTS for CREATE SCHEMA (#276)
This is a Postgres-specific clause: https://www.postgresql.org/docs/12/sql-createschema.html

Also add a test for `DROP SCHEMA IF EXISTS schema_name`, which is already supported in the parser.
2020-10-02 17:35:20 +03:00
Alex Dukhno
926b03a31d
Add parsing for PostgreSQL math operators (#267) 2020-09-30 05:29:31 +03:00
Nickolay Ponomarev
0ac343a116 Don't publish on the push of any tag
The tags are named vX.Y, and we'll be 0.x for a while, so limiting the
publish-crate action to run v0 tags seems good enough to avoid
accidental publishes.
2020-09-27 23:36:41 +03:00
Nickolay Ponomarev
cc4f51fe10 Update releasing.md docs 2020-09-27 23:34:21 +03: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
Nickolay Ponomarev
cf7263c294 Fix typo in the README
Closes https://github.com/ballista-compute/sqlparser-rs/issues/269
2020-09-07 04:31:07 +03:00
Nickolay Ponomarev
01a2a6bd0c
Update CHANGELOG (#261) 2020-09-07 04:11:26 +03:00
eyalleshem
1c6077c0db
[snowflake] Support single line comments starting with '#' or '//' (#264)
Co-authored-by: Eyal Leshem <eyal@satoricyber.com>
2020-09-07 03:57:37 +03:00
dependabot[bot]
e9aa87fa2c
Update bigdecimal requirement from 0.1 to 0.2 (#268)
Updates the requirements on [bigdecimal](https://github.com/akubera/bigdecimal-rs) to permit the latest version.
- [Release notes](https://github.com/akubera/bigdecimal-rs/releases)
- [Commits](https://github.com/akubera/bigdecimal-rs/compare/v0.1.0...v0.2.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-02 13:47:55 +02:00