refactor: make Lucene parser SQL generation generic for PostgreSQL, M…#6
Merged
Lutherwaves merged 1 commit intomainfrom Dec 31, 2025
Merged
Conversation
…ySQL, and SQLite - Renamed postgres_driver.go to sql_driver.go for generic SQL support - Refactored PostgresJSONBDriver to SQLDriver with provider field - Added provider-specific switch statements for: * Case-insensitive LIKE (ILIKE vs LOWER() vs LIKE) * Fuzzy search (similarity() vs SOUNDEX() vs error) * JSON field extraction (JSONB ->> vs JSON_EXTRACT) * Parameter placeholders ($N vs ?) - Updated ParseToSQL() to accept provider string parameter - Updated SQLAdapter.Search() to pass provider to parser - Updated all tests to include "postgresql" provider parameter - PostgreSQL: ILIKE, ::text casting, similarity(), JSONB ->> operators, $N placeholders - MySQL: LOWER() + LIKE, JSON_UNQUOTE(JSON_EXTRACT()), SOUNDEX(), ? placeholders - SQLite: LIKE (case-insensitive), JSON_EXTRACT(), no fuzzy search, ? placeholders
531e4c4 to
2caa6b3
Compare
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.
…ySQL, and SQLite
BREAKING CHANGE: ParseToSQL() now requires a provider parameter
Changes:
Provider-specific implementations:
This follows the existing codebase pattern used in storage/sql.go for handling provider-specific SQL differences via switch statements.