Fix(connector): expose id_column, timestamp_column, metadata_columns for MySQL/PostgreSQL incremental sync#13849
Open
buildearth wants to merge 1 commit intoinfiniflow:mainfrom
Open
Conversation
…for MySQL/PostgreSQL incremental sync
The MySQL and PostgreSQL sync classes in sync_data_source.py were not
passing id_column, timestamp_column, and metadata_columns to RDBMSConnector,
making incremental sync and document update impossible even when configured.
- Backend: pass id_column, timestamp_column, metadata_columns from self.conf
to RDBMSConnector for both MySQL and PostgreSQL
- Frontend: add ID Column, Timestamp Column, Metadata Columns form fields
to MySQL and PostgreSQL data source configuration UI with tooltips
Without id_column, updated records generate new documents instead of
overwriting existing ones. Without timestamp_column, poll_source always
falls back to full sync.
Signed-off-by: lixintao <lixintao@uniontech.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes MySQL/PostgreSQL incremental sync configuration wiring by exposing id_column, timestamp_column, and metadata_columns end-to-end (UI → sync classes → RDBMSConnector), enabling stable document IDs, incremental polling, and metadata extraction when configured.
Changes:
- Backend: pass
metadata_columns,id_column, andtimestamp_columnfrom sync config intoRDBMSConnectorfor MySQL and PostgreSQL. - Frontend: add form inputs (with tooltips) for
Metadata Columns,ID Column, andTimestamp Columnfor MySQL/PostgreSQL data sources.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| web/src/pages/user-setting/data-source/constant/index.tsx | Adds MySQL/PostgreSQL form fields to let users configure ID/timestamp/metadata columns. |
| rag/svr/sync_data_source.py | For MySQL/PostgreSQL sync, forwards the new config fields into RDBMSConnector to enable incremental sync and stable IDs. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13849 +/- ##
=======================================
Coverage 96.72% 96.72%
=======================================
Files 10 10
Lines 702 703 +1
Branches 112 112
=======================================
+ Hits 679 680 +1
Misses 5 5
Partials 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
@MkDev11 Hello can you help with this? |
Contributor
|
Sure |
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.
What problem does this PR solve?
The MySQL and PostgreSQL sync classes in
sync_data_source.pywere notpassing
id_column,timestamp_column, andmetadata_columnstoRDBMSConnector,making incremental sync and document update impossible even when configured.
id_column: updated records generate new documents instead ofoverwriting existing ones (doc ID is derived from content hash, so any
change produces a new ID).
timestamp_column:poll_sourcealways falls back to full sync,ignoring the configured time range.
inputs, so users had no way to fill them in.
Type of change
Changes
rag/svr/sync_data_source.py): passid_column,timestamp_column, andmetadata_columnsfromself.conftoRDBMSConnectorfor bothMySQLandPostgreSQLsync classes.web/src/pages/user-setting/data-source/constant/index.tsx):add
ID Column,Timestamp Column, andMetadata Columnsform fieldsto MySQL and PostgreSQL data source configuration UI with tooltips.