Skip to content

Read only old schema versions - #6

Merged
joelridden merged 2 commits into
mainfrom
compatibility
Sep 21, 2026
Merged

joelridden merged 2 commits into
mainfrom
compatibility

Conversation

@joelridden

Copy link
Copy Markdown
Contributor

Lets the current codebase open an older-schema IMDB read-only, instead of rejecting any schema_version mismatch outright.

Compatible versions are tracked explicitly in schema.READ_COMPATIBLE_SCHEMA_VERSIONS, a manually maintained set, not a range check, so future schema bumps can be added once their read path is confirmed unaffected. Write access (read_only=False) still requires an exact SCHEMA_VERSION match, this change only relaxes the read path.

Manually verified against 2 real older schema databases that all get_* methods return correct data under the new code.

Added tests covering:

  • opening an old
  • read-compatible schema version read-only succeeds
  • opening the same file read-write still raises RuntimeError

@lispandfound lispandfound left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, only one suggestion about one of the comments which you can ignore.

Comment thread imdb/schema.py
Co-authored-by: Jake Faulkner <jakefaulkn@gmail.com>
@joelridden
joelridden merged commit 48d665c into main Sep 21, 2026
7 checks passed
@joelridden
joelridden deleted the compatibility branch September 21, 2026 04:00
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.

2 participants