Repository navigation
Derive the asset id lazily: SQLite opens no longer hash the song (#108) - #110
Merged
Merged
Conversation
… its song (#108) open_graph_store / iter_scope_stores accept a zero-argument callable for asset_id, called only by the Postgres backend; FolderStorage.open_stores, open_project_graph and ProjectGraph.asset_id use it. A plain string still works. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #108.
asset_idis the Postgres tenant anchor and the media reference of new annotations; deriving it SHA-256s the whole song. It was computed eagerly on everyFolderStorage.open_stores,open_project_graphandProjectGraph(...)even under SQLite.open_graph_store/iter_scope_storesnow takeasset_idas astror a zero-argument callable; only the Postgres path calls it. A plain string behaves as before.FolderStorage.open_storesandopen_project_graph[_readonly]pass a callable;ProjectGraph.asset_idis acached_property(still computed once per graph).tests/test_lazy_asset_id.pyforbidslacing.hash_fileand opens stores, graph, readonly graph and the provenance walk (fails on main, passes here).Compatibility: public API only widened; no stored-data change. reelee needs no floor bump to keep working; it gets the speedup once it runs this nw version. Low-stakes change, so no adversarial review (per policy); full suite 786 passed, 3 skipped.
🤖 Generated with Claude Code