Skip to content

fix(example): reset persisted benchmark schema - #347

Draft
chrispader wants to merge 1 commit into
mainfrom
codex/reset-benchmark-schema
Draft

fix(example): reset persisted benchmark schema#347
chrispader wants to merge 1 commit into
mainfrom
codex/reset-benchmark-schema

Conversation

@chrispader

Copy link
Copy Markdown
Member

The benchmark database file persists across app restarts, but its module-scoped connection state does not. A fresh runtime can therefore reopen the existing Test table and fail before the benchmark starts. This extracts Samuel Scheit's fix from #298 by rebuilding the expected schema transactionally before inserting benchmark data. A native regression test starts with an incompatible table and checks that the reset restores every benchmark column.

Reproduction

  1. Run the large database benchmark once so the app creates its on-disk database.
  2. Restart the app without deleting that database.
  3. Run the benchmark again.

Before this change, the second run can fail because Test already exists. After this change, the reset replaces the persisted table before inserting benchmark rows.

Closes #345.

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.

Reset persisted benchmark schemas after app restarts

2 participants