forked from apache/datafusion-sqlparser-rs
-
Couldn't load subscription status.
- Fork 0
Sync #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Sync #1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add support for MSSQL SELECT TOP (N) [PERCENT] [WITH TIES] syntax.
"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
Accept non-standard `Select * from (a)` queries, where the table name is inside parentheses.
MySQL doesn't support the ROWS part of OFFSET. Teach the parser to remember which variant it saw, including just ROW.
…alect derive default for GenericDialect
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).
A non-standard feature supported at least by Postgres https://www.postgresql.org/docs/12/sql-createtable.html
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."
...updated the TODOs regarding single-quoted literals parsing while at it.
Report an error on unterminated string literals (and more)
…lows 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.
Fix GitHub CI failures.
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>
Specifically, `FOREIGN KEY REFERENCES <foreign_table> (<referred_columns>)` can now be followed by `ON DELETE <referential_action>` and/or by `ON UPDATE <referential_action>`.
This was discussed in #125, but we forgot to update the README at the time.
documentation updates
Support `CREATE SCHEMA schema_name` and `DROP SCHEMA schema_name`. Both ANSI SQL and Posgres define a number of options for the CREATE SCHEMA statement. They also support including other CREATE statements as part of the schema definition, rather than separate statements. This PR supports neither.
Following `<sort specification list>` from the standard https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#_10_10_sort_specification_list
This is a Postgres-specific clause: https://www.postgresql.org/docs/12/sql-createschema.html Also add a test for `DROP SCHEMA IF EXISTS schema_name`, which is already supported in the parser.
SimpleLogger is private in v1.6. Bumping its version in Cargo.toml makes `git pull && carg test` use the new version in an existing checkout (with an existing Cargo.lock file referencing the old version)
Co-authored-by: Eyal Leshem <eyal@satoricyber.com>
i.e. `WITH RECURSIVE ... AS ( ... ) SELECT` - see https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#with-clause Fixes #277
To share helper macros between various tests/* we added a new module (tests/macros/mod.rs). This made the prologue to be used in tests quite long and a little weird: ``` #[macro_use] #[path = "macros/mod.rs"] mod macros; use sqlparser::test_utils::*; ``` This simplifies it to: ``` #[macro_use] mod test_utils; use test_utils::*; ``` - and switches all existing tests to the new prologue simultaneously... ...while fixing a few other inconsistencies and adding a few comments about the way `test_utils` work.
It was an omission of the original implementation.
Snowflake diverges from the standard and from most of the other implementations by allowing extra parentheses not only around a join, but around lone table names (e.g. `FROM (mytable [AS alias])`) and around derived tables (e.g. `FROM ((SELECT ...) [AS alias])`) as well. Initially this was implemented in #154 by (ab)using `TableFactor::NestedJoin` to represent anything nested in extra set of parens. Afterwards we learned in #223 that in cases of such extraneous nesting Snowflake allows specifying the alias both inside and outside parens, but not both - consider: FROM (table_factor AS inner_alias) AS outer_alias We've considered implementing this by changing `TableFactor::NestedJoin` to a `TableFactor::Nested { inner: TableWithJoins, alias: Option<TableAlias> }`, but that seemed too generic, as no known dialect supports duplicate aliases, as shown above, nor naming nested joins `(foo NATURAL JOIN bar) alias`. So we decided on making a smaller change (with no modifications to the AST), that is also more appropriate to the contributors to the Snowflake dialect: 1) Revert #154 by rejecting `FROM (table or derived table)` in most dialects. 2) For `dialect_of!(self is SnowflakeDialect | GenericDialect)` parse and strip the extraneous parentheses, e.g. `(mytable) AS alias` -> `(mytable AS alias)` Co-authored-by: Eyal Leshem <eyal@satoricyber.com>
[snowflake] Support `FROM (table_name) alias`
…ease-config add a note about cargo release config
Introduce support for EXPLAIN [ANALYZE] [VERBOSE] <STATEMENT> syntax
* Support analyze table * Cleanup
* Parse floats without leading number * Move period token test * Comments * Enable test
* feat: support parsing multiple show variables. * fix: fix fmt error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sync