Skip to content

feat(storage): invalidate the cache on schema version change - #213

Merged
romaintb merged 2 commits into
mainfrom
feat/schema-version-cache-invalidation
Sep 4, 2026
Merged

romaintb merged 2 commits into
mainfrom
feat/schema-version-cache-invalidation

Conversation

@romaintb

@romaintb romaintb commented Sep 4, 2026

Copy link
Copy Markdown
Owner

The local SQLite database is retained between runs since #203, which means an entity change can leave the file holding tables the code no longer matches. Treat it as a cache rather than something to migrate: stamp the schema revision in PRAGMA user_version, and drop every table on a mismatch so init_schema rebuilds them from scratch.

Tables are dropped rather than the file unlinked, since another running Terminalist process may still hold the file open.

Summary

Describe the changes and the motivation.

Changes

  • Code changes
  • Tests added/updated
  • Docs updated (README/CHANGELOG)

Checklist

  • cargo fmt passes
  • cargo clippy -- -D warnings passes
  • cargo test passes

Related issues

#203 && #209

The local SQLite database is retained between runs since #203, which means
an entity change can leave the file holding tables the code no longer
matches. Treat it as a cache rather than something to migrate: stamp the
schema revision in PRAGMA user_version, and drop every table on a mismatch
so init_schema rebuilds them from scratch.

Tables are dropped rather than the file unlinked, since another running
Terminalist process may still hold the file open.
@romaintb romaintb self-assigned this Sep 4, 2026
@romaintb romaintb added the feat label Sep 4, 2026
@romaintb
romaintb marked this pull request as ready for review September 4, 2026 10:03
@romaintb
romaintb merged commit 019f0cf into main Sep 4, 2026
8 of 9 checks passed
@romaintb
romaintb deleted the feat/schema-version-cache-invalidation branch September 4, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant