Skip to content

fix date & add fts index#82

Merged
p-hoffmann merged 2 commits into
developfrom
p-hoffmann/date
Apr 27, 2025
Merged

fix date & add fts index#82
p-hoffmann merged 2 commits into
developfrom
p-hoffmann/date

Conversation

@p-hoffmann

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 27, 2025 10:54

Copilot AI 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.

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 () => {
Comment thread ext/trex/pipeline/sinks/duckdb/executor.rs Outdated
@p-hoffmann p-hoffmann requested a review from Copilot April 27, 2025 11:41

Copilot AI 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.

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", "'*'")
@p-hoffmann p-hoffmann merged commit 9f17ca8 into develop Apr 27, 2025
@p-hoffmann p-hoffmann deleted the p-hoffmann/date branch April 27, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants