Skip to content

feat(connector): support file_extension for MySQL/PostgreSQL sync - #19466

Merged
JinHai-CN merged 3 commits into
infiniflow:mainfrom
mkaaad:feat/go-rdbms-file-extension
Sep 14, 2026
Merged

JinHai-CN merged 3 commits into
infiniflow:mainfrom
mkaaad:feat/go-rdbms-file-extension

Conversation

@mkaaad

@mkaaad mkaaad commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Read file_extension from the connector config (default .txt) and use it as the document extension instead of the hardcoded .txt when rows are synced from MySQL and PostgreSQL data sources.
Python side: #15998

Read file_extension from the connector config (default .txt) and use it
as the document extension instead of the hardcoded .txt when rows are
synced from MySQL and PostgreSQL data sources.
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 83fbea10-cddb-4f34-a694-9a9aa7abfa50

📥 Commits

Reviewing files that changed from the base of the PR and between 11f4d11 and 2faf49b.

📒 Files selected for processing (5)
  • internal/syncer/connector/fingerprint.go
  • internal/syncer/connector/mysql.go
  • internal/syncer/connector/mysql_test.go
  • internal/syncer/connector/postgresql.go
  • internal/syncer/connector/postgresql_test.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change adds shared file-extension configuration handling and applies it to documents generated by MySQL and PostgreSQL connectors. Tests cover default, blank, dotted, dotless, custom, and end-of-batch behavior.

Changes

Configurable file extensions

Layer / File(s) Summary
File extension configuration contract
internal/syncer/connector/fingerprint.go
Adds fileExtensionFromConfig, which trims configured values and defaults unset or blank values to .txt without adding a leading dot.
MySQL document extension integration
internal/syncer/connector/mysql.go, internal/syncer/connector/mysql_test.go
MySQL stores the configured extension and assigns it to generated documents. Tests cover parsing and OpenSync/NextBatch behavior.
PostgreSQL document extension integration
internal/syncer/connector/postgresql.go, internal/syncer/connector/postgresql_test.go
PostgreSQL stores the configured extension and assigns it to generated documents. Tests cover parsing and OpenSync/NextBatch behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant Connector
  participant Database
  participant SourceDocument
  Caller->>Connector: OpenSync with file_extension
  Connector->>Database: Execute configured query
  Database-->>Connector: Return rows
  Connector->>SourceDocument: Set configured Extension
  Connector-->>Caller: Return document batch
Loading

Suggested reviewers: haruko386

Merge Risk: ⚪ Minimal · up to 2faf4

MySQL and PostgreSQL syncs can now assign configured file extensions to generated documents while retaining .txt for unset or blank configuration. No concrete current change risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 5 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding configurable file extensions for MySQL and PostgreSQL connectors.
Description check ✅ Passed The description explains the purpose, affected connectors, default value, and behavior change. It does not use the template's "### Summary" heading, but the required summary information is present.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the extension bright
.html hops in, .md takes flight
Blank paths settle on .txt
MySQL and Postgres carry the bits
Batches close with EOF tonight

Comment @coderabbitai help to get the list of available commands.

@mkaaad mkaaad added the ci Continue Integration label Sep 10, 2026
@JinHai-CN
JinHai-CN merged commit 0ff7e79 into infiniflow:main Sep 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants