Commit graph

206 commits

Author SHA1 Message Date
Maciej Obuchowski
4706d8b1d2
delete: add using clause, possibility of using aliases (#541)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
2022-07-18 10:29:03 -04:00
5tan
dea7666086
Boxed Query body to save some stack space (#540) 2022-07-16 07:22:45 -04:00
Maciej Obuchowski
5363d4e399
create table: add clone syntax (#542)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
2022-07-16 07:17:02 -04:00
sivchari
68768530cd
feat: Add WITH OFFSET Alias (#528)
* feat: Add WITH OFFSET Alias

* update: fix with_offset_alias type
2022-06-29 13:29:44 -04:00
Andrey Frolov
c884fbc388
add more consistency in ast (#523)
* add more consistency in ast

* refactor styling
2022-06-14 17:02:03 -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
Dmitry Patsura
d361c3a3a1
feat: Support CLOSE (cursors) (#515) 2022-06-06 16:09:17 -04:00
Yoshiyuki Komazaki
d19d955d9b
Support DATETIME keyword (#512) 2022-06-04 14:19:57 -04:00
sivchari
aa46e930c5
Support UNNEST as a table factor (#493)
* support unnest

* add test

* fix ast

* Update condition for BigQueryDialect or GenericDialect

I updated condition.
This changes conditionalize parsing for only BigQueryDialect or GenericDialect.

* Add some tests

* fix test
2022-05-27 06:27:51 -04:00
Riccardo Azzolini
0fa812bd2b
Fix parsing of COLLATE after parentheses in expressions (#507) 2022-05-25 16:10:38 -04:00
Riccardo Azzolini
901f5b974f
Distinguish between tables and nullary functions in FROM (#506) 2022-05-25 16:01:13 -04:00
Maciej Skrzypkowski
cd66034a4a
MERGE INTO semicolon handling (#508)
* SGA-4181 MERGE INTO semicolon handling

* fixed lint warning

Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>
2022-05-25 15:48:15 -04:00
Dmitry Patsura
4070f3ec6e
feat: Convert IS TRUE|FALSE to expression (#499) 2022-05-24 09:26:50 -04:00
George Andronchik
a6d7a35dac
feat: support DISCARD [ALL | PLANS | SEQUENCES | TEMPORARY | TEMP] (#500) 2022-05-22 15:44:53 -04:00
Maciej Obuchowski
7ab30d95b0
hive: add support for array<> (#491)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-05-22 15:38:24 -04:00
Yoshiyuki Komazaki
97a148aee4
Add BigQuery dialect (#490) 2022-05-10 10:25:27 -04:00
Maciej Skrzypkowski
9750841a66
Parse merge source as table factor (#483)
* Parse source of MERGE as table_factor

Some MERGE queries need a table as a soruce,
added proper test showing it

* Clippy fix

Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>
2022-05-10 06:34:45 -04:00
Alex Qyoun-ae
6b2fc8102f
feat: Support TABLE keyword with SELECT INTO (#487) 2022-05-09 14:29:43 -04:00
Maciej Obuchowski
835bb2f9ad
into keyword is optional (#473)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
2022-05-09 13:08:24 -04:00
Dmitry Patsura
8ef5fc8624
feat: Support ANY/ALL operators (#477)
* feat: Support ANY/ALL operators

* fix lint
2022-05-06 13:32:04 -04:00
yuval-illumex
7732c34b19
Add support in IS boolean filter (#474)
* Add support in IS TRUE IS FALSE

* Fix lint

* Add test for is false
2022-05-02 14:02:28 -04:00
Maciej Obuchowski
525ba527bb
snowflake: add qualify expression (#465)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
2022-04-29 14:11:11 -04:00
Andrew Lamb
edad20cbb8
Add negative tests for POSITION (#469) 2022-04-25 07:21:06 -04:00
yuval-illumex
8f4f01e517
Add Support in the "Position" Function (#463)
* Add support in the position function

* Add Test

* Add lint fixes

* Remove if

* Change from to in

* Remove special method for position

* Fix lint

* PR Review
2022-04-25 06:32:16 -04:00
Andrew Lamb
d2487445b7
Add negative test for IN parsing (#468) 2022-04-24 06:48:31 -04:00
yuval-illumex
278345d21a
Add support of NVARCHAR data type (#462)
* Add support of nvarchar data type

* Change the format type with capitals

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

* Add Test

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-04-20 17:25:50 -04:00
slhmy
fd8f2df10d
Support Update Set From statement (#450) 2022-04-02 06:34:59 -04:00
Matthew Turner
803fd6c970
Add CREATE DATABASE test and parsing (#451)
* Add test

* Fix CreateDatabse parsing

* Linting

* Cleanup for code style
2022-04-01 13:32:38 -04:00
Maciej Obuchowski
d38c30e9ff
add SELECT INTO statement variation (#447)
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
2022-03-30 16:01:55 -04:00
Maciej Obuchowski
6b55e51101
add support for MERGE statement (#430)
* add support for MERGE statement

Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>

* fix lint errors

Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
2022-03-12 14:28:57 -05:00
Yang Jiang
c688bbb4de
extract operator: add support for week keywords (#436) 2022-03-12 14:17:56 -05:00
Andrew Lamb
a28bbcd74c
Allow array to be used as a function name again (#432)
* Allow `array` to be used as a function

* clarify code, add docstrings

* fix docs

* cleanup

* fmt
2022-03-08 13:25:48 -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
Yoshiyuki Komazaki
0d1c5d1205
Support IN UNNEST(expression) (#426)
* feat: support `IN UNNEST(expression)`

* Add test for NOT IN UNNEST
2022-03-01 08:53:01 -05:00
gamife
0b5178d7e7
feat: add FOR UPDATE/FOR SHARE clause (#418)
* feat: add FOR UPDATE/FOR SHARE clause

* refactor: LockType enum variant name

Co-authored-by: gamife <gamife9886@gmail.com>
2022-02-24 06:39:38 +01:00
gamife
899f91b1f6
feat: add arg placeholder (#420)
Co-authored-by: gamife <gamife9886@gmail.com>
2022-02-17 07:55:21 -05:00
Andrew Lamb
d7f4f1aac9
Support MySQL style LIMIT X, Y (#415) 2022-02-09 06:44:51 -05:00
Andrew Lamb
ff558eeb61
Add Expr::tuple + parsing (#414) 2022-02-08 10:54:27 -05:00
Evgeny
8a3544abae
Fix panic with GRANT/REVOKE in CONNECT, CREATE, EXECUTE or TEMPORARY (#401)
* fix inconsistency between parse_grant_permissions and matched keywords

* Make it clear the error is an internal problem

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-02-08 10:50:55 -05:00
tvallotton
c4cbc8340a
Support DROP CONSTRAINT [ IF EXISTS ] <name> [ CASCADE ] (#396)
* adding support for DROP CONSTRAINT [ IF EXISTS ] <name>

* implementing [ CASCADE ] for DROP CONSTRAINT
2022-02-08 10:34:09 -05:00
Andrew Lamb
33d4f27bfc
Support OFFSET LIMIT as well as LIMIT OFFSET (#413)
* Inital support in current_timestamp

* Support time functions

* Add Test

* Fix order of offset

* Merge from main

* Fix PR

* Update Test

* Do not allow repeated LIMIT or OFFSET

Co-authored-by: Yuval Shkolar <yuval@illumex.ai>
2022-02-05 07:46:53 -05:00
Andrew Lamb
5cbf1e797a
Fix new clippy errors (#412) 2022-02-05 06:53:33 -05:00
yuval-illumex
fbc1d9659b
Support parentheses in DISTINCT clause, CURRENT_TIMESTAMP, CURRENT_TIME, and CURRENT_DATE (#391)
* Inital support in current_timestamp

* Support time functions

* Add Test

* Fix PR

* Fix tests

* Add Support for distinct with parentheses

* Fix nightly
2022-02-05 06:39:35 -05:00
Zach Hamlin
9569d1b215
feat: comment and alter column support (#381)
* feat: add support for postgresql comment keyword

* feat: add alter column and rename constraint
2021-12-17 12:19:08 -05:00
Taehoon Moon
823635d2fc
Add FunctionArgExpr and remove Expr::[Qualified]Wildcard, (#378)
* Add FunctionArgExpr and remove Expr::[Qualified]Wildcard,

There is no use case of `Expr::Wildcard` and `Expr::QualifiedWildcard` only except for function argments.
Add `FunctionArgExpr` to have `Wildcard` and `QualifiedWildcard`, and remove wildcards in `Expr`.

* Apply `FunctionArgExpr` to sqlparser_mysql tests
2021-12-15 06:35:37 -05:00
Poonai
4c121a92a6
support for session transaction and transaction snapshot. (#379)
* add support for snapshot id in set transaction

Signed-off-by: poonai <rbalajis25@gmail.com>

* add support for default session transaction characteristics

Signed-off-by: poonai <rbalajis25@gmail.com>

* add additional assertion for parse_set_transaction test

Signed-off-by: poonai <rbalajis25@gmail.com>

* Fix clippy

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2021-12-14 15:13:12 -05: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
Jiayu Liu
40d67aab87
parse grouping sets, rollup, and cube for postgresql (#366)
* parse grouping sets, rollup, and cube

* add postgresql flag
2021-12-10 14:45:09 -05:00
Ben Cook
d7e84be3e1
Add basic support for GRANT and REVOKE (#365)
* Add basic support for GRANT privileges on tables and sequences

* Cargo fmt

* Make enum for granted privileges

* Implement and use Display for GrantObjects

* Simplify Display for GrantPrivileges

* Add column privileges

* Add second column privilege to test

* Add REVOKE privileges and reformat

* Fix some clippy warnings

* Fix more clippy

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2021-12-08 15:55:23 -05:00
Daniël Heres
0f0b327e97
Implement is [not] distinct from (#361)
* Implement is [not] distinct from

* Simplify message

* Clippy
2021-10-14 18:26:28 +02:00