8000 [BUG] Preserve existing table when seed replacement fails by eddiethedean · Pull Request #63 · dmux/minilake · GitHub
[go: up one dir, main page]

Skip to content

[BUG] Preserve existing table when seed replacement fails - #63

Merged
dmux merged 4 commits into
dmux:mainfrom
eddiethedean:fix/mcp-seed-table-atomic-57
Oct 28, 2026
Merged

dmux merged 4 commits into
dmux:mainfrom
eddiethedean:fix/mcp-seed-table-atomic-57

Conversation

@eddiethedean
Copy link
Copy Markdown
Collaborator

Closes #57

seed_table could erase an existing table's rows before validating replacement data, and recreate=true could drop the table before rejecting an invalid schema.

This change validates recreated schemas and rows in a disposable managed table before touching the target. Normal reseeds now run DELETE and INSERT in one transaction, and failed SQL transactions are rolled back before the shared DuckDB connection is reused. MCP regression tests verify that invalid values and types preserve the original table, schema, and rows.

Validation:

  • tests/mcp_server/test_uc_tools.py — 14 passed
  • tests/test_sql_statements.py tests/mcp_server/test_sql_tools.py — 45 passed
  • ruff check, ruff format --check, and git diff --check passed

@eddiethedean
Copy link
Copy Markdown
Collaborator Author

Ready to merge.

Reviewed the full PR at cdc241259b087dfa8595eac92ae559c60d4a21b3; no remaining high or critical findings.

All CI checks passed on this commit: lint, UI, and the full Docker test suite (411 passed). CI run

Additional review validation passed: 124 focused Dockerized tests plus MCP checks for failed-replacement preservation, transaction recovery, schema recreation, empty replacements, escaped values, and staging cleanup. GitHub reports the PR is mergeable with a clean merge state.

@dmux dmux self-assigned this Oct 28, 2026
@dmux dmux added the bug Something isn't working label Oct 28, 2026
@dmux
dmux merged commit 7bdc60b into dmux:main Oct 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Failed MCP seed_table calls erase existing table data before validating the replacement

2 participants

0