Skip to content
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

Enable custom dialects to support MATCH() AGAINST() #1719

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

joocer
Copy link
Contributor

@joocer joocer commented Feb 9, 2025

The logic for if a dialect supports MATCH() AGAINST() was coded into the parser to look for specific dialects rather than the dialects attesting they support the syntax. This meant that custom dialects were unable to take advantage of this feature.

The changes involve updating the Dialect trait and its implementations for the MySQL and Generic SQL dialects which support MATCH() AGAINST(), as well as modifying the parser to use the new method for determining support for this syntax.

Key changes include:

Dialect Trait Updates:

  • src/dialect/mod.rs: Added a new method supports_match_against to the Dialect trait to indicate whether a dialect supports the MATCH() AGAINST() syntax.

Dialect Implementations:

  • src/dialect/generic.rs: Implemented the supports_match_against method for the GenericDialect to return true.
  • src/dialect/mysql.rs: Implemented the supports_match_against method for the MySqlDialect to return true.

Parser Update:

  • src/parser/mod.rs: Updated the parser to use the supports_match_against method to check if the dialect supports the MATCH() AGAINST() syntax.

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

Thanks @joocer!
cc @alamb

@iffyio iffyio merged commit 322209a into apache:main Feb 10, 2025
9 checks passed
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.

2 participants