Commit graph

570 commits

Author SHA1 Message Date
Nickolay Ponomarev
1cf9e5ecef Update README: we support bits and pieces from other dialects too 2020-05-27 19:45:18 +03:00
Nickolay Ponomarev
a2f4996bdd Update README to point to SQL:2016, instead of 2011
This was discussed in #125, but we forgot to update the README at the time.
2020-05-27 19:45:18 +03:00
Nickolay Ponomarev
8d5eaf95b3 Update CHANGELOG 2020-05-27 19:44:59 +03:00
Christoph Müller
98f97d09db
Add support for "on delete cascade" column option (#170)
Specifically, `FOREIGN KEY REFERENCES <foreign_table> (<referred_columns>)`
can now be followed by `ON DELETE <referential_action>` and/or by
`ON UPDATE <referential_action>`.
2020-05-27 18:24:23 +03:00
Nickolay Ponomarev
789fcc8521
Merge pull request #167 from mashuai/add_index_support
Adds support for the most common forms of CREATE INDEX, and for DROP INDEX:

	CREATE [ UNIQUE ] INDEX [ IF NOT EXISTS ]
	    <index_name>
	    ON <table_name>
	    ( col_name [, ...] )

	DROP INDEX <index_name>
2020-05-27 05:13:06 +03:00
Nickolay Ponomarev
320d2f2d05 Update CHANGELOG.md and a fix last-minute review nit 2020-05-27 05:04:22 +03:00
mashuai
5aacc5ebcd add create index and drop index support 2020-05-27 09:27:57 +08:00
Nickolay Ponomarev
2644bc4ac7
Merge pull request #171 from nickolay/master
Fix GitHub CI failures.
2020-05-26 21:47:25 +03:00
Nickolay Ponomarev
8406a938d5 Port the changes made to travis configuration in #159 to GitHub workflows
This should fix the build failures due to unavailable components, e.g.

error: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is unavailable for download for channel nightly
Sometimes not all components are available in any given nightly.
2020-05-26 21:35:12 +03:00
Nickolay Ponomarev
f614481133
Merge pull request #165 from nickolay/pr/unterminated-string-literal
Report an error on unterminated string literals (and more)
2020-05-26 06:42:35 +03:00
Nickolay Ponomarev
7d60bfd866 Update CHANGELOG.md 2020-05-10 21:50:06 +03:00
Nickolay Ponomarev
327e6cd9f1 Report an error for unterminated string literals
...updated the TODOs regarding single-quoted literals parsing while at it.
2020-05-10 21:21:01 +03:00
Nickolay Ponomarev
40853fe412 Fix a recently implemented clippy lint
https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
"Import with single component use path such as `use cratename;`
is not necessary, and thus should be removed."
2020-05-10 21:16:25 +03:00
Alex Dukhno
5ad578e3e5
Implement CREATE TABLE IF NOT EXISTS (#163)
A non-standard feature supported at least by Postgres

https://www.postgresql.org/docs/12/sql-createtable.html
2020-04-21 16:28:02 +03:00
Nickolay Ponomarev
06865113d7 Update comments (follow-up to PR #158) 2020-04-20 05:43:57 +03:00
Nickolay Ponomarev
af852e78f6
Merge pull request #158 from mjibson/offset-rows
Add support for OFFSET without the ROWS keyword (a MySQL quirk, documented at https://dev.mysql.com/doc/refman/8.0/en/select.html)

Teach the parser to remember which variant it saw (ROWS/ROW/none).
2020-04-20 05:38:04 +03:00
Nickolay Ponomarev
5fe9060d4e
Merge pull request #162 from alex-dukhno/derive-defaul-for-generic-dialect
derive default for GenericDialect
2020-04-20 05:13:12 +03:00
Matt Jibson
c0b0b5924d Add support for OFFSET with the ROWS keyword
MySQL doesn't support the ROWS part of OFFSET. Teach the parser to
remember which variant it saw, including just ROW.
2020-04-19 20:06:08 -06:00
Nickolay Ponomarev
05a29212ff Update comments (follow-up to PR #155)
https://github.com/andygrove/sqlparser-rs/pull/155
2020-04-20 04:58:24 +03:00
Nickolay Ponomarev
33303b244f
Merge pull request #155 from eyalleshem/master
Accept non-standard `Select * from (a)` queries, where the table name is inside parentheses.
2020-04-20 04:57:12 +03:00
Nickolay Ponomarev
b9f1ff685a
Merge pull request #159 to fix Travis CI 2020-04-20 03:02:54 +03:00
Alex Dukhno
baacc956ea derive default for GenericDialect 2020-04-19 13:07:00 +03:00
Nickolay Ponomarev
dcc624c561 Make CI handle missing rustfmt in the nightly 2020-04-14 19:48:15 +03:00
Nickolay Ponomarev
4ce0eb11ae Fix a new clippy lint (.nth(0)) to unbreak CI
"iter.next() is equivalent to iter.nth(0), as they both consume the
next element, but is more readable."

https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
2020-04-14 17:09:48 +03:00
Eyal Leshem
3255fd3ea8 Add support to to table_name inside parenthesis 2020-04-12 20:31:09 +03:00
Alex Kyllo
172ba42001 Add support for MSSQL's SELECT TOP N syntax (#150)
Add support for MSSQL SELECT TOP (N) [PERCENT] [WITH TIES] syntax.
2020-01-12 23:20:48 -05:00
Nikhil Benesch
4cdd6e2f84
Merge pull request #143 from apparebit/quote-id-quote
Support quoted identifiers in AST as well
2019-10-20 00:20:44 -04:00
Robert Grimm
b1cbc55128
Turn type Ident into struct Ident
The Ident type was previously an alias for a String. Turn it into a full
fledged struct, so that the parser can preserve the distinction between
identifier value and quote style already made by the tokenizer's Word
structure.
2019-10-20 00:16:41 -04:00
Andy Grove
9b2287f14c
Merge pull request #142 from andygrove/github-action
Add Github Action
2019-10-17 20:50:46 -06:00
Andy Grove
a2613f9dd1 format 2019-10-17 20:41:49 -06:00
Andy Grove
0687d3aca8 stable rust 2019-10-17 20:38:22 -06:00
Andy Grove
7730e5762a use stable rust 2019-10-17 20:35:09 -06:00
Nickolay Ponomarev
8c88294966
Merge pull request #141 from andygrove/changelog-0.5.0
Update CHANGELOG.md for 0.5.0
2019-10-17 23:50:51 +03:00
Andy Grove
41eda23ede test 2019-10-17 04:26:00 -06:00
Andy Grove
60448382c2 experimenting with github actions 2019-10-17 04:21:49 -06:00
Andy Grove
9b49db35ff
Add github action 2019-10-17 04:12:11 -06:00
Nickolay Ponomarev
489f157f17
Update CHANGELOG.md for 0.5.0 2019-10-11 00:18:35 +03:00
Andy Grove
adeb3f1f52 version bump 2019-10-10 08:09:26 -06:00
Andy Grove
8757a33013 version bump 2019-10-10 08:08:22 -06:00
Nikhil Benesch
c7021ed145
Merge pull request #139 from gaffneyk/master
Allow semicolon after start transaction
2019-09-14 00:25:44 -04:00
gaffneyk
2bb38c9b27
Parse START TRANSACTION when followed by a semicolon
Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
2019-09-13 22:54:21 -04:00
Nikhil Benesch
abf68c6af6
Merge pull request #138 from andygrove/fix-skew
Fix merge skew with number literals
2019-09-02 09:48:57 -04:00
Nikhil Benesch
b8fe800da5
Fix merge skew with number literals 2019-09-02 09:37:38 -04:00
Nikhil Benesch
e9c5567b04
Merge pull request #135 from andygrove/show-columns
Support MySQL `SHOW COLUMNS` statement
2019-09-02 07:40:57 -04:00
Nikhil Benesch
f4df34074c
Merge pull request #130 from andygrove/decimal
Don't lose precision when parsing decimal fractions
2019-09-02 07:40:31 -04:00
Nikhil Benesch
a0aca824e8
Optionally parse numbers into BigDecimals
With `--features bigdecimal`, parse numbers into BigDecimals instead of
leaving them as strings.
2019-09-01 13:21:49 -04:00
Nikhil Benesch
b5621c0fe8
Don't lose precision when parsing decimal fractions
The SQL standard requires that numeric literals with a decimal point,
like 1.23, are represented exactly, up to some precision. That means
that parsing these literals into f64s is invalid, as it is impossible
to represent many decimal numbers exactly in binary floating point (for
example, 0.3).

This commit parses all numeric literals into a new `Value` variant
`Number(String)`, removing the old `Long(u64)` and `Double(f64)`
variants. This is slightly less convenient for downstream consumers, but
far more flexible, as numbers that do not fit into a u64 and f64 are now
representable.
2019-09-01 13:21:30 -04:00
Nikhil Benesch
e1ded184f8
Support SHOW <var> and SET <var> 2019-09-01 13:20:37 -04:00
Nikhil Benesch
2bef9ec30a
Merge pull request #121 from andygrove/ci-fmt
Check that CI enforces rustfmt
2019-08-27 18:15:43 -04:00
Brandon W Maister
f64928e994
Support MySQL SHOW COLUMNS statement
Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
2019-08-14 15:13:05 -04:00