Skip to content

fix(db): declare transaction() on local Database interface#1

Open
lukeboyett wants to merge 1 commit intomainfrom
fix/db-transaction-type
Open

fix(db): declare transaction() on local Database interface#1
lukeboyett wants to merge 1 commit intomainfrom
fix/db-transaction-type

Conversation

@lukeboyett
Copy link
Copy Markdown
Owner

Summary

  • Upstream commit fee576b ("fix: migrate legacy lowercase paths on reindex") added a db.transaction(...) call in src/store.ts but did not extend the local cross-runtime Database interface in src/db.ts
  • As a result, npm run build fails on a fresh clone of main:
src/store.ts(2142,22): error TS2339: Property 'transaction' does not exist on type 'Database'.
  • Both underlying engines (better-sqlite3 on Node, bun:sqlite on Bun) expose transaction(fn), so this just makes the type reflect reality. One line, no behavior change.

Test plan

  • `npm install && npm run build` passes (was failing on `main` before this change)
  • Existing tests still pass (CI)

Notes

This is a micro-PR extracted from a larger downstream branch; opening it here first for automated review.

The narrow cross-runtime Database interface in src/db.ts defines the
subset of better-sqlite3 / bun:sqlite methods used throughout QMD.
Commit fee576b ("fix: migrate legacy lowercase paths on reindex")
introduced a db.transaction(...) call in src/store.ts but did not
extend the interface, breaking `tsc -p tsconfig.build.json`:

  src/store.ts(2142,22): error TS2339: Property 'transaction' does
  not exist on type 'Database'.

Both underlying engines expose transaction(fn), so this just makes
the type reflect reality.
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