Skip to content

Add FULLTEXT support for MySQL and Generic dialects#702

Merged
alamb merged 1 commit into
apache:mainfrom
AugustoFKL:mysql-and-generic-fulltext-index
Nov 11, 2022
Merged

Add FULLTEXT support for MySQL and Generic dialects#702
alamb merged 1 commit into
apache:mainfrom
AugustoFKL:mysql-and-generic-fulltext-index

Conversation

@AugustoFKL

Copy link
Copy Markdown
Contributor

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

@coveralls

coveralls commented Nov 6, 2022

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 3424850968

  • 53 of 61 (86.89%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 86.178%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser.rs 18 20 90.0%
src/ast/ddl.rs 17 23 73.91%
Totals Coverage Status
Change from base Build 3413823174: 0.003%
Covered Lines: 11622
Relevant Lines: 13486

💛 - Coveralls

Comment thread src/ast/ddl.rs Outdated
Comment on lines +288 to +290
/// Whether the type is followed by the keyword `KEY` (Some(true)), `INDEX` (Some(false)),
/// or no keyword at all (None).
opt_key: Option<bool>,

Copy link
Copy Markdown
Contributor

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,
}

🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do it asap!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamb done!

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- thanks @AugustoFKL

Comment thread src/ast/ddl.rs
Comment on lines +367 to +369
if !matches!(index_type_display, KeyOrIndexDisplay::None) {
write!(f, " {}", index_type_display)?;
}

Copy link
Copy Markdown
Contributor

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

Suggested change
if !matches!(index_type_display, KeyOrIndexDisplay::None) {
write!(f, " {}", index_type_display)?;
}
write!(f, " {}", index_type_display)?;

Copy link
Copy Markdown
Contributor Author

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);

@alamb alamb merged commit cdf4447 into apache:main Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants