Skip to content

feat(mysql): import preview and column mapping (#2600) - #2652

Merged
openai0229 merged 35 commits into
OtterMind:mainfrom
Aias00:feature/mysql-import-preview-2600
Sep 8, 2026
Merged

openai0229 merged 35 commits into
OtterMind:mainfrom
Aias00:feature/mysql-import-preview-2600

Conversation

@Aias00

@Aias00 Aias00 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closes #2600

Summary

  • Preview endpoint: bounded rows (first row = header) + source fields/samples + target columns (type/nullable/default/auto-increment) + suggested mapping by exact name.
  • Mapping import: remap/skip source fields, unmapped target columns use DEFAULT or explicit NULL; unmapped NOT NULL no-default columns block execution before any write.
  • Per-row continue-on-error with source row / target column / message; numeric/date coercion; totals + row errors returned.
  • Import modal shows the mapping step after file selection (preview table + mapping selects + strategy + result summary).
  • i18n ×5 + MYSQL-IMPORT-001 fixtures (reordered, extra-column, strict-table CSV samples).

Test plan

  • Run MYSQL-IMPORT-001 README verification (auto mapping, reordered, skip extra column, NOT NULL block, DEFAULT/NULL strategy, invalid numeric row, large-file bounded preview)

- Bounded preview endpoint (CSV/XLS/XLSX via the same EasyExcel reader as
  execution): source fields with sample values, target columns with type/
  nullable/default, and a suggested mapping by exact name match.
- Mapping-driven import: remap source fields to target columns, skip
  source fields, fill unmapped target columns with DEFAULT or explicit
  NULL; NOT NULL columns without a default block execution before any
  write when unmapped.
- Row-level error reporting (source row, target column, message) with
  per-row continue-on-error; type coercion for numeric/date columns.
- Import modal gains a mapping step after file selection; i18n in all
  five locales and MYSQL-IMPORT-001 fixtures (reordered/extra columns,
  strict table, CSV samples).
Copilot AI lite review requested due to automatic review settings August 7, 2026 08:39
@Aias00
Aias00 requested a review from openai0229 as a code owner August 7, 2026 08:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openai0229

openai0229 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Follow-up review after the latest main integration: changes are still requested before merge.

The current DbImportPreviewServiceImpl still reads the entire client-supplied path with Files.readAllBytes(), does not restrict that path, and executes the import synchronously outside the TaskService workflow. The DEFAULT path omits unmapped columns from the INSERT but still binds every target column, so parameter counts diverge; skippedCount remains zero and executeBatch() is called once per row without a defined transaction/partial-failure policy. Please fix these shared execution semantics in the cumulative import branch and rerun CI.

Aias00 added 3 commits August 19, 2026 05:14
Constraint: preserve the PR's preview/mapping flow while adopting main's task submission and artifact handling
Rejected: dropping preview mapping | would silently remove the feature under review
Confidence: high
Scope-risk: narrow
Tested: NODE_PATH=/Users/aias/Work/github/Chat2DB/chat2db-community-client/node_modules node ./scripts/validate-i18n.cjs --write-source-hashes; git diff --cached --check
# Conflicts:
#	chat2db-community-client/scripts/i18n-source-hashes.json
@Aias00
Aias00 requested a review from a team as a code owner August 23, 2026 06:36
Aias00 added 2 commits August 30, 2026 21:54
Signed-off-by: liuhy <liuhongyu@apache.org>
Signed-off-by: liuhy <liuhongyu@apache.org>
@openai0229
openai0229 merged commit 76f3340 into OtterMind:main Sep 8, 2026
16 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[MYSQL-IMPORT-001] Add import preview and explicit column mapping

4 participants