Skip to content

Show only the query history of the open database - #43

Merged
necessarylion merged 1 commit into
mainfrom
history-per-database
Nov 8, 2026
Merged

necessarylion merged 1 commit into
mainfrom
history-per-database

Conversation

@necessarylion

Copy link
Copy Markdown
Owner

Problem

The history list in the Query tab showed queries that ran on other databases. Each entry only saved the tab title, and the list had no filter.

Fix

  • Each entry now saves a database key: driver, host, port and database. For SQLite it is the file path. The user is not part of it.
  • The list, its count and Clear use only the entries of the database open in the tab. Remove still works by id.
  • The key comes from the tab's connection, so the list follows a switch of database with the database picker.
  • Each database keeps up to 200 entries, so a busy database does not push out the others. All databases together keep up to 2000, so the storage cannot grow without end.
  • Old entries were saved without a database key. They are dropped when the history is read.

Note

A USE statement typed in the query editor does not change the database of the tab in the app today. So the history follows the database picker, not a typed USE.

Checks

  • bun run lint, bun run typecheck: clean
  • bun test: 399 pass

The history list in the Query tab showed queries from all databases.
Each entry now saves a key of its database (driver, host, port and
database, or the file path for SQLite). The list, the count and Clear
use only the entries of the database open in the tab. The list follows
a switch of database.

Each database keeps up to 200 entries. All databases together keep up
to 2000. Old entries were saved without a database, so they are dropped.
@necessarylion
necessarylion merged commit cc6bd1b into main Nov 8, 2026
4 checks passed
@necessarylion
necessarylion deleted the history-per-database branch November 8, 2026 01:39
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