Repository navigation
DDL parsing improvements - #65
Merged
Merged
Conversation
Pull Request Test Coverage Report for Build 228
💛 - Coveralls |
- merge PrimaryKey and UniqueKey variants - support `CHECK` constraints, removing the separate `Key` struct - make `CONSTRAINT constraint_name` optional - remove `KEY` without qualifiers (wasn't parsed and there doesn't appear to be such a thing) - change `UNIQUE KEY` -> `UNIQUE` - change `REMOVE CONSTRAINT` -> `DROP CONSTRAINT` and note its parsing is not implemented Spec: - ANSI SQL: see <table constraint definition> in https://jakewheat.github.io/sql-overview/sql-2011-foundation-grammar.html#_11_6_table_constraint_definition - Postgres: look for "and table_constraint is:" in https://www.postgresql.org/docs/11/sql-altertable.html
<table element> ::= ... | <table constraint definition> | ... https://jakewheat.github.io/sql-overview/sql-2011-foundation-grammar.html#table-element-list
Since other ALTER statements will have separate sub-commands.
At least MSSQL supports it, not sure about others.
The tokenizer emits a separate Token for +/- signs, so the value of Value::Long() (as well as of parse_literal_int()) may never be negative. Also we have been using both u64 and usize to represent a parsed unsigned number. Change to using u64 for consistency.
nickolay
force-pushed
the
pr/ddl-improvements
branch
from
June 2, 2019 11:01
1492f42 to
d9edc25
Compare
Contributor
Author
|
@benesch I've rebased this on master, please take a look - is this good to merge or would you rather finish landing your patches? |
Contributor
|
Boy, I wish I'd looked at this before I implemented all this myself. 🤦♂ I think you should merge this, and then I'll fix any mismatches between our two implementations (if there even are any). |
benesch
approved these changes
Jun 2, 2019
Contributor
Author
|
OK, merged. Thanks for the quick reply! |
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
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.
See the individual commits' messages.
I wasn't sure which of unsized types to pick in andygrove@1492f42 -- if there's a reason to pick another one, please let me know.