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
Add FULLTEXT support for MySQL and Generic dialects #702
Add FULLTEXT support for MySQL and Generic dialects #702
Conversation
Pull Request Test Coverage Report for Build 3424850968
💛 - Coveralls |
src/ast/ddl.rs
Outdated
/// Whether the type is followed by the keyword `KEY` (Some(true)), `INDEX` (Some(false)), | ||
/// or no keyword at all (None). | ||
opt_key: Option<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an enum would be easier to use here
enum SpatialKey {
Key,
Index,
None,
}
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do it asap!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alamb done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thanks @AugustoFKL
if !matches!(index_type_display, KeyOrIndexDisplay::None) { | ||
write!(f, " {}", index_type_display)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since KeyOrIndexDisplay::None
is displayed as ""
I suspect you don't even have to have this test
if !matches!(index_type_display, KeyOrIndexDisplay::None) { | |
write!(f, " {}", index_type_display)?; | |
} | |
write!(f, " {}", index_type_display)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alamb the problem is that i'd have an additional space compared to the input string. Although it isn't incorrect, IMHO would be weird to print something like:
CREATE TABLE tb (c1 TEXT, FULLTEXT (c1, c2);
feat: add FULLTEXT (1), (2), option on create table for MySQL and Generic dialects.
[1] : https://dev.mysql.com/doc/refman/8.0/en/create-table.html
[2] : https://dev.mysql.com/doc/refman/8.0/en/fulltext-natural-language.html