chore(sqlx): trim stale offline query cache files#678
Draft
nicolasburtey wants to merge 1 commit intomainfrom
Draft
chore(sqlx): trim stale offline query cache files#678nicolasburtey wants to merge 1 commit intomainfrom
nicolasburtey wants to merge 1 commit intomainfrom
Conversation
5bdb9b0 to
3032db8
Compare
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.
Summary
list_for(...)usage in ledger repos with explicit query methods for only theby(created_at)paths we actually call:AccountSetRepo::list_for_name_by_created_at(_in_op)EntryRepo::{list_for_account_id_by_created_at, list_for_journal_id_by_created_at, list_for_transaction_id_by_created_at}TransactionRepo::list_for_tx_template_id_by_created_at(_in_op)list_for(...)annotations from those columns to avoid generating unused fallback filter/sort combinationsImpact
.sqlxcache surface in bothcala-ledger/.sqlxandcala-server/.sqlx*_by_created_atmethods)Validation
cargo sqlx migrate run(cala-ledger)make sqlx-prepareSQLX_OFFLINE=true cargo check -p cala-ledgerSQLX_OFFLINE=true cargo check -p cala-serverNote
Medium Risk
Mostly a cache-surface reduction, but it changes the generated SQL and pagination ordering/cursors for some list queries (e.g., account sets by
namenow ordered bycreated_at), which could subtly affect result ordering or paging behavior.Overview
Refactors repo listing APIs to stop relying on macro-generated
list_for(...)query permutations and instead provide explicit, instrumented*_by_created_atmethods for the only call paths in use (account sets byname, entries byaccount_id/journal_id/transaction_id, and transactions bytx_template_id, including*_in_opvariants where needed).As a result, regenerates SQLx offline metadata and deletes a large set of now-unused
.sqlx/query-*.jsoncache files in bothcala-ledgerandcala-server, leaving only the narrowed query shapes (notably changing account-set pagination to be ordered/cursored bycreated_atrather thanname).Written by Cursor Bugbot for commit 5bdb9b0. This will update automatically on new commits. Configure here.