Commit graph

701 commits

Author SHA1 Message Date
Alex Vasilev
ea0eb1be61
fix: mysql backslash escaping (#373)
* fix: mysql backslash escaping

* fixes
2021-12-23 08:50:33 -05:00
Simon Liu
60ad78dafc
Enable map access for function, add ClickHouse dialect (#382)
* 1 Add ClickHouse dialects.
2 Enable map access for function.

* 1 Fixed compilation errors.
2 Modify the code according to @alamb's comments.

* Fixed compilation errors.
2021-12-21 16:16:30 -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
a81805ea30
Update to 0.13.1 alpha (#377)
I think I messed up cargo release, which has previously done this automatically
2021-12-11 07:15:07 -05:00
Andrew Lamb
e3269c158d (cargo-release) version 0.13.0 2021-12-10 15:00:47 -05:00
Andrew Lamb
a954f2de90 Update pre-commit version 2021-12-10 15:00:35 -05:00
Andrew Lamb
adaaab35e3
Update changelog for version 0.13.0 (#376) 2021-12-10 14:56:26 -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
Jiayu Liu
d33bacf679
use 2021 edition (#368)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2021-12-08 15:44:20 -05:00
Andrew Lamb
41997b5750
Fix one last clippy warning (#374) 2021-12-08 15:41:07 -05:00
Jiayu Liu
0e1027ce96
fix clippy warnings (#367) 2021-12-08 08:27:00 +01:00
Heres, Daniel
9c87d3b195 Update release docs for new cargo release version 2021-10-14 18:35:36 +02:00
Heres, Daniel
a1937719b3 Update release notes 2021-10-14 18:32:23 +02: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
Qinxuan Chen
c9f8a44b55
Move the keywords module (#352)
* Move the keywords mod from dialect mod into the root of library

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

* re-export keywords from dialect for backwards compatiblity

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-09-26 07:59:39 -04:00
Andrew Lamb
3dd89ac44d (cargo-release) start next development iteration 0.11.1-alpha.0 2021-09-25 14:49:54 -04:00
Andrew Lamb
c2f9cfd2f0 (cargo-release) version 0.11.0 2021-09-25 14:49:54 -04:00
Andrew Lamb
8c39cec24c
Add release notes for 0.11.0 (#360) 2021-09-25 14:46:07 -04:00
Guillaume Balaine
d498887a5d
Enable map access for numbers, multiple nesting levels (#356)
* enable integer keys for map access

* enable map access for number keys

* Add tests for string based map access

* MapAccess: unbox single quoted strings to always display double quoted strings for map access

* cargo fmt

* cargo clippy

* Fix compilation with nostd by avoiding format!

* fix codestyle

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2021-09-24 14:22:12 -04:00
John
014b82f03d
Add logical xor (#357) 2021-09-18 06:39:35 -04:00
Qinxuan Chen
a8901becc3
Rname Token::Mult to Token::Mul (#353)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-09-16 16:50:10 -04:00
Hoon Wee
e32b1c56c8
Add gluesql as a reference (#355) 2021-09-16 07:34:18 +02:00
Qinxuan Chen
3d6637c4f3
Improve tokenizer error (#347)
* Improve tokenizer error

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

* Add test for TokenizerError

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-09-10 11:33:13 -04:00
Qinxuan Chen
10ec257e21
Use derive(Default) for HiveFormat (#348)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-09-09 12:24:17 -04:00
Dmitry Patsura
d2d4fc0c58
feat: Support DESCRIBE table_name (#340)
* feat: Support DESCRIBE

* feat: Support DESCRIBE table_name

* Update src/ast/mod.rs

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

* Update src/ast/mod.rs

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

* Update src/ast/mod.rs

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

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2021-09-09 11:49:33 -04:00
Qinxuan Chen
d8adb1708c
Eliminate redundant string copy of Tokenizer (#343)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2021-09-02 09:20:31 +02:00
Alex Vasilev
77d90d3b85
Support minimum display width for integer data types (#337)
* Support minimum display width for integers

* make fmt happy, updated docstrings
2021-08-29 07:13:10 -04:00
Dmitry Patsura
9a5716d94b
feat: Support SHOW CREATE TABLE|EVENT|FUNCTION (MySQL specific) (#338)
* feat: Support SHOW CREATE TABLE|EVENT|FUNCTION (MySQL specific)

* misc: Simplify test with loop over enum values
2021-08-29 07:03:39 -04:00
dependabot[bot]
69af5a1d99
Update bigdecimal requirement from 0.2 to 0.3 (#341)
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.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: bigdecimal
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 12:29:55 +02:00
TheSchemm
70ffa4166c
Support Parsing of hexadecimal literals that start with 0x (#324)
* Add support for 0x prefixed bin literal

* Add tests

* Fix formatting for test
2021-08-25 12:57:32 -04:00
joshwd36
a95c81fb13
Add referential actions to TableConstraint foreign key (#306)
* Add referential actions to TableConstraint foreign key

* Remove copy/paste error

* Add referential actions to TableConstraint foreign key

* Add additional tests
2021-08-25 12:03:10 -04:00
Andrew Lamb
f56e57470e (cargo-release) start next development iteration 0.10.1-alpha.0 2021-08-23 15:47:06 -04:00
Andrew Lamb
4d5aaa79b9 (cargo-release) version 0.10.0 2021-08-23 15:47:06 -04:00
Andrew Lamb
7e7d870e78
Add release notes for 0.10.0 (#336)
* Add release notes for 0.10.0

* Add mention of TRIM syntax
2021-08-23 15:42:01 -04: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
Hoon Wee
5ce67177b3
Fix the term 'Modulus' to 'Modulo' (#335) 2021-08-23 12:05:42 +02:00
Andrew Lamb
31549b9241
Merge pull request #333 from andygrove/update-cargo-toml
Update links to reflect repository move to sqlparser-rs GitHub org
2021-08-23 06:01:32 -04:00
Andrew Lamb
2d04266a8e
Merge pull request #312 from PsiACE/main
Add fuzzer based on honggfuzz
2021-08-23 05:59:45 -04:00
Andy Grove
9c9d9293b5 fix typo 2021-08-21 06:54:49 -06: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
Andy Grove
3e34392230 Update links to reflect repository move to sqlparser-rs GitHub org 2021-08-20 17:05:02 -06:00
Andy Grove
5ebc06b20c Update links to reflect repository move to sqlparser-rs GitHub org 2021-08-20 17:03:06 -06:00
Andrew Lamb
293133f910
Merge pull request #313 from Jimexist/add-default-for-window-frame
add default value for window frame
2021-08-20 14:11:11 -04:00
Jiayu Liu
950daf39bb add default value for window frame 2021-08-20 13:55:53 -04:00
Andrew Lamb
783bc21d29
Merge pull request #328 from b41sh/regexp_match
Add support for PostgreSQL regex match
2021-08-20 13:54:24 -04:00
Jiseok CHOI
e548d38de8
Support TRIM syntax (#331)
* Support TRIM syntax

- Implement the following cases
- TRIM([BOTH | LEADING | TRAILING] <expr> [FROM <expr>])
- TRIM(<expr>)

* Resolve 1.54.0 clippy error

- Remove needless borrow

* Add test cases for TRIM
2021-08-20 08:53:52 +02:00