Enable custom dialects to support MATCH() AGAINST()
#1719
Merged
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.
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 supportMATCH() 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 methodsupports_match_against
to theDialect
trait to indicate whether a dialect supports theMATCH() AGAINST()
syntax.Dialect Implementations:
src/dialect/generic.rs
: Implemented thesupports_match_against
method for theGenericDialect
to returntrue
.src/dialect/mysql.rs
: Implemented thesupports_match_against
method for theMySqlDialect
to returntrue
.Parser Update:
src/parser/mod.rs
: Updated the parser to use thesupports_match_against
method to check if the dialect supports theMATCH() AGAINST()
syntax.