fix date & add fts index#82
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes date handling issues and adds functionality to create full-text search (FTS) indexes in DuckDB. Key changes include updating test publication slots and adding new replication commands and FTS index creation logic.
- Updated publication slot value in tests.
- Added new replication command op_copy_tables and integrated FTS index creation.
- Updated dependencies and serialization for table names.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/main/test_main.ts | Updated publication slot in tests and added a new "dbquery json" test case |
| ext/trex/pipeline/sinks/duckdb/executor.rs | Inserted call to create an FTS index after copying a table |
| ext/trex/lib.rs | Updated replication command definitions and added op_copy_tables operator |
| ext/trex/js/trex_lib.js | Modified publication key formation and integrated op_copy_tables usage |
| ext/trex/conversions/table.rs | Added Serialize/Deserialize derivations for TableName |
| ext/trex/clients/duckdb.rs | Introduced create_fts_index function for FTS index creation in DuckDB |
| ext/trex/Cargo.toml | Updated dependency definitions for arrow-json and added arrow-array |
Comments suppressed due to low confidence (2)
ext/trex/clients/duckdb.rs:87
- Ensure that the generated PRAGMA statement conforms to DuckDB’s expected syntax for creating an FTS index; verify that parameter quoting and formatting are correct.
let query = format!("PRAGMA create_fts_index({}.{}.{}, {}, {})", &self.current_database, table_name.schema, table_name.name, "concept_id", "'*'");
test/main/test_main.ts:262
- [nitpick] Test case name 'dbquery json' appears inconsistent with the naming pattern used in other tests; consider aligning it (e.g., using a similar pattern as 'dbquery #6') for improved clarity.
"dbquery json": async () => {
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses an issue with the date handling in tests and introduces a full text search (FTS) index creation for DuckDB tables.
- Updated test publication slot and added a new test for JSON queries.
- Extended the replication command to support copying multiple tables with the new FTS index functionality.
- Updated the DuckDB client to implement an FTS index creation function and adjusted related modules to support the changes.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/main/test_main.ts | Updated publication slot and added a new test for JSON queries. |
| ext/trex/pipeline/sinks/duckdb/executor.rs | Added call to create an FTS index after table copy. |
| ext/trex/lib.rs | Updated replication command and adjusted retries logic for CopyTable. |
| ext/trex/js/trex_lib.js | Modified publication key generation and added handling for cases with no publications. |
| ext/trex/conversions/table.rs | Added serde support to TableName. |
| ext/trex/clients/duckdb.rs | Implemented create_fts_index for FTS support, constructing a new SQL query. |
| ext/trex/Cargo.toml | Updated arrow-json dependency and added arrow-array dependency. |
| .github/workflows/docker-build-push.yml | Commented out the delete untagged images step. |
Comments suppressed due to low confidence (1)
ext/trex/clients/duckdb.rs:87
- Consider quoting or properly escaping the database, schema, and table names in the constructed SQL query to prevent potential issues if any of these identifiers contain special characters.
let query = format!("PRAGMA create_fts_index({}.{}.{}, {}, {})", &self.current_database, table_name.schema, table_name.name, "concept_id", "'*'")
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.
No description provided.