Skip to content

fix(history): Linux runs and MCP queries keep the database they ran in - #4775

Merged
datlechin merged 2 commits into
mainfrom
fix/linux-history-run-database
Nov 30, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/linux-history-run-database

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • The Linux app's query history now records the database each run went to, so a synced run shows another device where it ran. Windows does the same since fix(sync): a deleted connection's history deletions sync, pulls keep saved-query edits, and Windows runs keep their database #4763.
  • Editor runs record the tab's database where the run begins, else the session's own. They capture it before a typed USE moves the tab, as Windows does.
  • Row saves, structure saves and CSV imports record the database of the session they run on (ran_statements.rs, workspace_handle.rs, ui/workspace/import.rs).
  • MCP queries record the held session's database: the database the client named, else the session's own, else a client-named database that held_session took as the connection's own (core/crates/mcp/src/query_tools.rs). This is core code, so Windows' MCP runs gain it too.
  • A file engine, or a login that named no database, still records none.

Test plan

  • run_history.rs: an editor entry carries the database it was given, and none for a file.
  • ran_statements.rs: a save in analytics records it, and a save with no database records none.
  • ui/editor/tests.rs: on a session in shop, a run records shop, and after picking analytics the next run records analytics.
  • core/crates/mcp/tests/mcp_server.rs: a query in the archive database the window holds records archive.
  • Local, in the linux-dev container:
    • cargo fmt clean;
    • clippy -D warnings on tablepro-mcp and tablepro, and on tablepro --no-default-features;
    • verify.sh test tablepro-mcp (the server tests named) 9/9;
    • verify.sh test tablepro --lib (history, saves, import, editor) 202/202;
    • verify.sh l10n pass.
  • Codex review and security pass, 2 rounds plus a fix:
    • round 1: MCP history had no database, and the editor test did not pin the fallback. Both fixed.
    • round 2: a client naming the connection's own database on a login with no named database recorded none. Fixed after the round, and not pinned by a test, since the MCP harness's SQLite files have no login default.
  • Not pinned by a test: that the database is captured before a typed USE moves the tab mid-run, since the fake session cannot run a USE.

datlechin added a commit that referenced this pull request Nov 30, 2026
@datlechin
datlechin force-pushed the fix/linux-history-run-database branch from 528d227 to d44b936 Compare November 30, 2026 15:18
@datlechin
datlechin merged commit 664b105 into main Nov 30, 2026
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant