feat: introduce rest catalog cache primitives - #372
Merged
Conversation
…onal - Extract HTTP mechanics into private fetch_inner returning reqwest::Response - fetch becomes a thin wrapper (T: DeserializeOwned), absorbing fetch_empty - fetch_conditional returns Conditional<T> for 304-aware endpoints - Conditional::Modified now carries the full HeaderMap instead of a single extracted etag string, letting callers access any response header - load_table is non-generic, always returns Conditional<LoadTableResult> - No FromResponse trait needed; no fetch_empty function needed
This was referenced Jul 15, 2026
Owner
|
Thanks a lot for the PR. IT would be great to get this in. I've made a PR splitgraph#23 where a refactored the |
load_table returns LoadTableResult directly — no wrapping, ergonomic for callers that don't need cache semantics. load_table_conditional returns Conditional<LoadTableResult> and is the right call when passing If-None-Match; it can return NotModified. This avoids surprising callers of load_table with a Conditional return type when no If-None-Match header was sent.
…rait refactor: replace FromResponse trait with fetch_inner + fetch_conditi…
Owner
|
Sorry for the linting issues I pushed to the other PR. |
Owner
|
Otherwise looks good to me. |
Contributor
Author
no worries, lint fixes pushed. |
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.
Progresses #268.
This PR adds new primitives for handling the HTTP cache semantics when loading a table:
Conditionalenum in the rest crateLoadTableResultandConditional<LoadTableResult>viaFromResponsetraitfetchandfetch_emptyare consolidated to remove code duplication.Finally, this is also exposed at the
catalog_api_api::load_tablelevel, which now accepts headers, and can returnConditional::NotModifiedwhen aIf-None-Matchheaders is passed, end the ETag is still matching.