Skip to content

fix(history): a SQLite database is a path, not localhost//a/path - #276

Merged
huyplb merged 1 commit into
mainfrom
fix/history-file-database-label
Aug 19, 2026
Merged

fix(history): a SQLite database is a path, not localhost//a/path#276
huyplb merged 1 commit into
mainfrom
fix/history-file-database-label

Conversation

@huyplb

@huyplb huyplb commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Closing out the schema-history friendliness pass, found by reading the shipped v0.2.111 build rather than the diff.

The bug

The History header and the database picker both rendered:

sqlite · localhost//tmp/foxschema-e2e-schema-history-mszbgfmn/history.db · main

The location was built by joining host and database with a slash. A file dialect has no host — so localhost was glued onto a path that already begins with /, producing the double slash. Two call sites each did their own join, so both were wrong the same way.

databaseLocation now decides per dialect and both labels read it.

After: sqlite · /tmp/foxschema-e2e-schema-history-mszbgfmn/history.db · main, in the header and the picker, verified in the running app.

Verified live in v0.2.111 while I was there

The rest of the friendliness pass is confirmed shipped and working:

"reused" in user-facing text gone — reads "11 changed · 10 unchanged"
"Lokee" / "content-addressed" gone
MQT filter on a schema with none gone
React Flow attribution badge gone
Type filters match what the database contains (table, view, index, column, trigger)

Gates

tsc --noEmit clean · vitest run 1968 pass / 2 expected-fail · eslint 0 errors.

🤖 Generated with Claude Code


Note

Low Risk
Display-only label logic in the history UI with no auth, data, or API changes; covered by unit tests.

Overview
Fixes schema history labels that showed localhost//path for SQLite/DuckDB by centralizing how a captured database’s location is formatted.

Adds databaseLocation in historyCompare.ts: for sqlite and duckdb it uses only the file path (ignoring host); for server dialects it still joins host and database, omitting empty halves. lokeeDatabaseLabel and LokeeWeaveView’s describe() now call it so the history header and database picker stay consistent.

Tests cover file vs server dialects, partial host/database fields, empty location fallback, and picker-style labels.

Reviewed by Cursor Bugbot for commit c561849. Bugbot is set up for automated code reviews on this repo. Configure here.

Last of the schema-history friendliness pass, found by reading the shipped
v0.2.111 build rather than the diff: the header and the database picker both
rendered `sqlite · localhost//tmp/app.db · main`. The location was built by
joining host and database with a slash, and a file dialect has no host — so a
value that means nothing for SQLite or DuckDB was glued onto a path that already
starts with one.

`databaseLocation` now decides per dialect and both labels read it, instead of
each joining the parts itself.

The rest of that pass is confirmed live in v0.2.111: no "reused" and no "Lokee"
in user-facing text, no MQT filter on a schema that has none, no React Flow
badge, and the type filters match what the database actually contains.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_158ec2ec-dfb2-4c8f-a921-85831d938aaa)

@huyplb
huyplb merged commit 22d0c34 into main Aug 19, 2026
11 checks passed
@huyplb
huyplb deleted the fix/history-file-database-label branch August 19, 2026 03:47
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