Commit graph

398 commits

Author SHA1 Message Date
liadgiladi
eb4be98980
Support DROP TEMPORARY TABLE, MySQL syntax (#916) 2023-08-07 10:54:24 -04:00
Ophir LOJKINE
10a6ec5637
Fix "BEGIN TRANSACTION" being serialized as "START TRANSACTION" (#935) 2023-07-27 07:32:55 -04:00
Ophir LOJKINE
53593f1982
Fix parsing of datetime functions without parenthesis (#930) 2023-07-26 15:47:02 -04:00
Andrew Lamb
3a412152b9
fix parsing of identifiers after % symbol (#927) 2023-07-21 05:55:41 -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
Igor Izvekov
df45db1375
fix: parsing JsonOperator (#913) 2023-07-17 15:03:48 -04:00
Andrew Lamb
4efe55dd8a
Remove most instances of #[cfg(feature(bigdecimal))] in tests (#910) 2023-07-17 14:19:51 -04:00
Jay Zhan
20ac38b4da
Support multi args for unnest (#909)
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-06-30 16:50:46 -04:00
liadgiladi
f05f71e20d
Support ALTER VIEW, MySQL syntax (#907)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-06-29 13:33:51 -04:00
Igor Izvekov
8877cbafa6
fix: unary negation operator with operators: Mul, Div and Mod (#902) 2023-06-22 11:15:31 -04:00
Sam Rijs
2b37e4ae6e
Add support for CREATE TYPE (AS) statements (#888)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-06-08 06:56:39 -04:00
Andrew Lamb
f740d528da
Fix merge conflict (#885) 2023-05-18 15:28:11 -04:00
Berkay Şahin
ef46cd3752
Named window frames (#881)
* after over clause, named window can be parsed with window ... as after having clause

* Lint errors are fixed

* Support for multiple windows

* fix lint errors

* simplifications

* rename function

* Rewrite named window search in functional style

* Test added and some minor changes

* Minor changes on tests and namings, and semantic check is removed

---------

Co-authored-by: Mustafa Akur <mustafa.akur@synnada.ai>
Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
2023-05-18 15:00:24 -04:00
Mustafa Akur
1b86abebe2
Add support for first, last aggregate function parsing (#882)
* Add order by parsing to functions

* Fix doc error

* minor changes
2023-05-18 14:59:14 -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
Mustafa Akur
482a3ad417
Add support for multiple expressions, order by in aggregations (#879)
* Add support for multiple expressions, order by in aggregations

* Fix formatting errors

* Resolve linter errors
2023-05-17 13:04:33 -04:00
Armin Primadi
f15da8772e
Make Expr::Interval its own struct (#872)
* Make Expr::Interval its own struct

* Add test interval display

* Fix cargo fmt
2023-05-09 20:42:03 -04:00
Aljaž Mur Eržen
0113bbd924
Test trailing commas (#859)
* test: add tests for trailing commas

* tweaks
2023-05-01 08:31:17 -04:00
Aljaž Mur Eržen
3b1076c194
Support DISTINCT ON (...) (#852)
* Support "DISTINCT ON (...)"

* a test

* fix the merge
2023-04-27 15:34:54 -04:00
AviRaboah
f72e2ec382
Support multiple-table DELETE syntax (#855) 2023-04-27 11:41:20 -04:00
Andrew Lamb
00d071286b
Move tests from parser.rs to appropriate parse_XX tests (#845)
* Move tests from parser.rs to appropriate parse_XX tests

* move to postgres tests

* move more tests
2023-04-10 09:48:23 -04:00
pawel.leszczynski
29dea5d017
support PIVOT table syntax (#836)
Signed-off-by: Pawel Leszczynski <leszczynski.pawel@gmail.com>
2023-03-26 07:33:35 -04:00
Maciej Skrzypkowski
a1b7341b87
Non-Latin characters support (#840)
* Non latin characters

---------

Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>

* Test for mysql

---------

Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>
2023-03-23 07:07:17 -04:00
Andrew Lamb
7f4c9132d7
Fix table alias parsing regression in 0.31.0 by backing out redshift column definition list (#827)
* Fix table alias parsing regression

* Revert "Support redshift's columns definition list for system information functions (#769)"

This reverts commit c35dcc93a7.
2023-03-06 11:43:22 -05:00
Mykhailo Bondarenko
1cf913e717
feat: Support PostgreSQL exponentiation. (#813)
* Add Postgres exponent operator

* Parse caret as BinaryOperator::PGExp in PostgreSQL

* Update sqlparser_postgres.rs

* update tests to support PGExp

* cargo fmt

* improve extensibility

* cargo fmt

* redundant code and documentation lionks
2023-03-02 10:39:39 -05:00
Y Togami
fbbf1a4e84
feat: support BIGNUMERIC of bigquery (#811)
* add tests

* bignumeric data type

* bignumeric keyword

* fix doc

* add exact_number_info

* fix doc

* check result string
2023-03-02 10:38:00 -05:00
Maciej Skrzypkowski
c35dcc93a7
Support redshift's columns definition list for system information functions (#769)
* parsing of redshift's column definition list for
pg_get_late_binding_view_cols
pg_get_cols
pg_get_grantee_by_iam_role
pg_get_iam_role_by_user

* Renamed ColsDefinition to TableAliasDefinition

added generic dialect

* Tests fixed

* Visitor for IdentPair

* Parsing redshift table alias based on indentifier and
parentheses instead of function name

* fix clippy

---------

Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-02-17 14:04:59 -05:00
Y Togami
79009f5448
feat: support JSON keyword (#799)
* feat: support json keyword for bigquery

* chore: fix test

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-02-17 13:46:30 -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
henry
61c661c234
Support ALTER INDEX {INDEX_NAME} RENAME TO {NEW_INDEX_NAME} (#767)
* test: add a case `rename_index`

* feat: add AlterIndex match arm

* fix: remove todo with self.expected

* chore: add comment to unreachable
2022-12-28 08:35:27 -05:00
Jeffrey
f0870fd315
Enable grouping sets parsing for GenericDialect (#771) 2022-12-28 08:31:39 -05:00
Andrew Lamb
79d0baad73
Add configurable recursion limit to parser, to protect against stack overflows (#764) 2022-12-28 08:29:51 -05:00
Jeffrey
2c20ec0be5
Support parsing scientific notation (such as 10e5) (#768) 2022-12-28 08:28:53 -05:00
Audun Skaugen
fb02344131
Generalize locking clause (#759)
Postgres supports more generalized locking clauses, for example:
FOR UPDATE OF <table_name> SKIP LOCKED

also, multiple locking clauses. Generalize the parser to support these.

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-12-13 17:19:07 -05:00
Ziinc
d420001c37
fix: unnest join constraint with alias parsing for BigQuery dialect (#732)
* fix: unnest join constraint with alias parsing for BigQuery dialect

* chore: fix failing tests
2022-12-13 16:44:45 -05:00
Wei-Ting Kuo
bda8268e56
add keyword NANOSECOND (#749) 2022-12-06 15:29:41 -05:00
Augusto Fotino
b3688513eb
feat: add support for except clause on wildcards (#745) 2022-12-05 14:03:59 -05:00
Sarah Yurick
528b3f2234
Support CREATE TABLE x AS TABLE y (#704)
* first commit

* fix style and edit test

* fix test?

* remove unnecessary logic

* refactor implementation

* codestyle

* add schema support

* codestyle and lint

* Apply suggestions from code review

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

* PartialOrd and Ord

* clean up parser logic

* codestyle and lint

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-12-01 09:56:14 -05:00
Aljaž Mur Eržen
8e1c90c0d8
Support MySQL ROWS syntax for VALUES (#737)
* Adapt VALUES to MySQL dialect

* Update src/ast/query.rs

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

* remove *requirement* for ROW

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-12-01 09:46:55 -05:00
yuval-illumex
a422116b89
inital commit (#736) 2022-11-30 13:33:15 -05:00
mao
316359760d
Support USING method when creating indexes. (#731)
* fix: create index using function

* fix: code style

Co-authored-by: yangjiaxin <yangjiaxin@qianxin.com>
2022-11-30 13:17:38 -05:00
mingmwang
96bca38fae
Support SEMI/ANTI JOIN syntax (#723) 2022-11-30 12:57:45 -05:00
Augusto Fotino
fa6bd01b19
Support EXCLUDE support for snowflake and generic dialect (#721)
The exclude clause can be used after a possibly qualified on SELECT
2022-11-30 12:29:43 -05:00
Augusto Fotino
886875f3bf
Support for IF NOT EXISTS in ALTER TABLE ADD COLUMN (#707) 2022-11-29 15:37:14 -05:00
Wei-Ting Kuo
bae682255d
add set time zone sometimezone as a exception while parsing keyword::set (#727)
* add set time zone sometimezone as a exception while parsing keyword::set

* remove redundant parentheses

* add Statement::SetTimeZone

* delete useless comments
2022-11-28 16:16:08 -05:00
Sarah Yurick
57083a0df1
Fix interval parsing logic and precedence (#705)
* initial fix

* add comma

* add test

* style

* add more tests

* codestyle fix
2022-11-22 07:45:47 -05:00
unvalley
4b1dc1abf7
Support UPDATE ... FROM ( subquery ) in some dialects (#694)
* Apply UPDATE SET FROM statement for some dialects

* Add GenericDialect to support

* Test SnowflakeDialect

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-11-11 16:37:09 -05:00
main()
814367a6ab
Implement ON CONFLICT and RETURNING (#666)
* Implement RETURNING on INSERT/UPDATE/DELETE

* Implement INSERT ... ON CONFLICT

* Fix tests

* cargo fmt

* tests: on conflict and returning

Co-authored-by: gamife <gamife9886@gmail.com>
2022-11-11 16:15:31 -05:00
Augusto Fotino
65c5a37bce
feat: add precision for TIME, DATETIME, and TIMESTAMP data types (#701)
Now all those statements are both parsed and displayed with precision
and timezone info. Tests were added to the ones presented in the ANSI
standard.
2022-11-11 16:06:57 -05:00
SuperBo
87b4a168cb
Parse ARRAY_AGG for Bigquery and Snowflake (#662) 2022-11-11 15:25:07 -05:00