Commit graph

65 commits

Author SHA1 Message Date
ehoeve
83e30677b0
Add support for table-level comments (#946)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-08-17 06:44:55 -04:00
Jeremy Maness
8bbb85356c
Fix SUBSTRING from/to argument construction for mssql (#947) 2023-08-17 06:17:57 -04:00
liadgiladi
eb4be98980
Support DROP TEMPORARY TABLE, MySQL syntax (#916) 2023-08-07 10:54:24 -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
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
097e7ad56e
feat: Support MySQL's DIV operator (#876)
* feat: MySQL's DIV operator

* fix: do not use `_` prefix for used variable

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-05-17 13:26:14 -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
3e92ad349f
Support identifiers beginning with digits in MySQL (#856) 2023-04-26 09:27:04 -04:00
Coby Geralnik
04d9f3af2e
Added support for Mysql Backslash escapes (enabled by default) (#844) 2023-04-10 09:56:01 -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
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
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
Maciej Skrzypkowski
488e8a8156
Support MySQL Character Set Introducers (#788)
* MySQL Character Set Introducers

* Documentation fix

* Parsing string introducer from Token::word

* Fixed lint

* fix clippy

---------

Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2023-02-17 13:38:43 -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
Jeffrey
98403c07b1
Allow parsing of mysql empty row inserts (#783) 2023-01-02 06:51:13 -05:00
김진성 Kim Jinsung
3e990466f8
Support CREATE TABLE ON UPDATE <expr> Function (#685)
* feat : OnUpdate Function Implement

* feat : add GenericDialect Options
2022-12-28 08:59:09 -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
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
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
Augusto Fotino
09d53623bc
Support MATCH AGAINST (#708)
Support added for both MySQL and Generic dialects.
2022-11-30 12:16:50 -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
Augusto Fotino
cdf4447065
feat: add FULLTEXT option on create table for MySQL and Generic dialects (#702) 2022-11-11 16:03:39 -05:00
ding-young
27c3ec87db
Support ALTER TABLE DROP PRIMARY KEY (#682)
* parse alter table drop primary key

* cargo nightly fmt

* add Dialect validation
2022-11-02 10:15:33 -04:00
AugustoFKL
2aba3f8c91
Adding MySQL table option {INDEX | KEY} to the CREATE TABLE definiton (partial). (#665)
Theoretically the behavior should be the same as CREATE INDEX, but we
cannot make that assumption, so the parse is (almost) identical as the
input.

Breaking changes:
- Now HASH and BTREE are KEYWORDS, and using them as names can result in
  errors.
- Now 'KEY' and 'INDEX' column names start the parsing of a table constraint if unquoted for the Generic dialect. This results in possible conficts if canonical results are compared for all dialects if a column is named 'key' without quotes.
2022-10-19 17:24:38 -04:00
AugustoFKL
3beecc0a7a
Correct order of arguments in LIMIT x,y , restrict to MySql and generic dialects (#642)
* 613 Fixing MySQL LIMIT syntax

* 613 Reducing logic to real case scenario

* 613 Adding syntax to generic dialect
2022-10-01 17:23:06 -04:00
AugustoFKL
e951cd5278
#625 adding mediumint support (#630) 2022-09-28 16:26:17 -04:00
Dmitry Patsura
6d8aacd85b
feat: Support expression in SET statement (#574)
Co-authored-by: Alex Vasilev <vaspiring@gmail.com>
2022-08-18 13:29:55 -04:00
Alex Qyoun-ae
18881f8fcf
Support SHOW COLLATION (#564) 2022-08-11 09:28:34 -04:00
Dmitry Patsura
54a29e872d
feat: Parse special keywords as functions (current_user, user, etc) (#561)
* feat: Parse special keywors as functions (current_user, user, etc)

* explain special field
2022-08-11 08:30:06 -04:00
Alex Qyoun-ae
b6e36ad760
Support SHOW TABLES (#563) 2022-08-11 08:24:40 -04:00
Dmitry Patsura
221e9c2bab
feat: Support SET NAMES literal [COLLATE literal] (#558)
* feat: Support SET NAMES literal [COLLATE literal]

* feat: Support SET NAMES DEFAULT

* clippy
2022-08-11 06:55:55 -04:00
Alex Qyoun-ae
a9db6ed139
Support USE db (#565) 2022-08-11 06:49:20 -04:00
Alex Qyoun-ae
71c3ec057b
Support SHOW COLUMNS FROM tbl FROM db (#562) 2022-08-11 06:42:08 -04:00
Dmitry Patsura
e2b943799a
feat: Initial support for parsing MySQL show variables (#559)
Co-authored-by: Alex Vasilev <vaspiring@gmail.com>
2022-08-11 06:35:59 -04:00
Mike Roberts
93e16e9864
Add support for mysql 'SHOW CREATE VIEW' statement (#536) 2022-07-18 06:10:09 -04:00
5tan
dea7666086
Boxed Query body to save some stack space (#540) 2022-07-16 07:22:45 -04:00
Yoshiyuki Komazaki
17c238bda7
feat: Support double quoted string (#530) 2022-06-28 16:41:23 -04:00
Andrey Frolov
99697d26e1
add on update for my sql (#522) 2022-06-13 08:33:10 -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
Riccardo Azzolini
901f5b974f
Distinguish between tables and nullary functions in FROM (#506) 2022-05-25 16:01:13 -04:00
Dmitry Patsura
f5980cd30f
feat: Support KILL statement (#479) 2022-05-02 14:04:33 -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
slhmy
fd8f2df10d
Support Update Set From statement (#450) 2022-04-02 06:34:59 -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
Wataru Kurashima
994b86a45c
mysql unsigned datatype (#428)
* support MySQL UNSIGNED

* fix: 🐛 `unsigned` is not column option

* test: 💍 add `unsigned` test

* fix: 🐛 `unsigned` is not column option

* feat: 🎸 declare unsigned data_types

* feat: 🎸 display unsigned

* fix: 🐛 unsigned is not column type option

* feat: 🎸 parse_data_type can parse unsigned

* feat: 🎸 int or decimal or float is unsigned selectable

* fix: 🐛 FLOAT/DOUBLE/DECIMAL + UNSIGNED is not recommended

https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html

* test: 💍 add test

* style: 💄 fmt
2022-03-07 17:01:48 -05:00
Wataru Kurashima
2ebe18a94e
Support COLLATION keywork on CREATE TABLE (#424)
* support table definition's collate

* add table collate test
2022-02-28 14:04:47 -05:00