Skip to content

sqlite: no more destructive version bumps#21847

Merged
owenlin0 merged 1 commit into
mainfrom
owen/no_more_deleting_sqlite
May 9, 2026
Merged

sqlite: no more destructive version bumps#21847
owenlin0 merged 1 commit into
mainfrom
owen/no_more_deleting_sqlite

Conversation

@owenlin0
Copy link
Copy Markdown
Collaborator

@owenlin0 owenlin0 commented May 8, 2026

Why

We'd like SQLite state to become required and load-bearing. As a first step, let's remove the mechanism that allows us to blow away the SQLite DB on a version bump, and instead rely on graceful migrations.

The original motivation (PR) behind this mechanism was to care less about backwards compatibility while SQLite was being landed, but I'd say it's quite important now to keep the data in it.

What changed

  • Make STATE_DB_FILENAME and LOGS_DB_FILENAME the full canonical filenames: state_5.sqlite and logs_2.sqlite.
  • Remove STATE_DB_VERSION / LOGS_DB_VERSION and the helper that constructed filenames from versions.
  • Stop StateRuntime::init from scanning for or deleting older SQLite DB filenames at startup.
  • Delete the tests that encoded legacy state/logs DB deletion behavior.

Verification

  • cargo test -p codex-state

@owenlin0 owenlin0 changed the title sqlite: no more destructive version bumps sqlite: treat current DB filenames as canonical May 8, 2026
@owenlin0 owenlin0 changed the title sqlite: treat current DB filenames as canonical sqlite: no more destructive version bumps May 8, 2026
@owenlin0 owenlin0 force-pushed the owen/no_more_deleting_sqlite branch from 11ba610 to c6ecaf6 Compare May 8, 2026 23:55
@owenlin0 owenlin0 marked this pull request as ready for review May 8, 2026 23:59
@owenlin0 owenlin0 requested a review from jif-oai May 8, 2026 23:59
@owenlin0 owenlin0 merged commit 95ca276 into main May 9, 2026
26 checks passed
@owenlin0 owenlin0 deleted the owen/no_more_deleting_sqlite branch May 9, 2026 00:29
@github-actions github-actions Bot locked and limited conversation to collaborators May 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants