Repository navigation
feat(rd-rds): add bounded lazy-load database access - #35
Merged
Merged
Conversation
This was referenced Sep 18, 2026
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.
Installed R packages retain namespace objects in lazy-load
.rdx/.rdbdatabases, butrd-rdspreviously had no bounded API for accessing those records without an R session. This adds an opt-inlazyloadfeature that preserves stored variables and persistence references in index order, applies last-wins lookup for duplicate names, and reads direct raw or zlib records with explicit resource limits and file-change detection.The
lazyloadfeature enablesgzipbecause normal installed-package.rdxindexes are gzip-enveloped RDS files. Cargo still resolves a singleflate2dependency for the index envelope and zlib record layer. The public compression name follows R's terminology for the unsupported code-3 profile (Xz), while bzip2 and xz record decoding remain outside this milestone.The reader preserves unknown persistence-reference shapes as unsupported entries, but reports malformed known direct or compound descriptors as invalid index data. This keeps forward-compatible enumeration separate from corruption.
Fixtures cover serialization versions 2 and 3, raw and zlib records, duplicate bindings, compound and unknown references, malformed known references, invalid ranges, limits, unsupported codecs, and data-file replacement. An additional fixture is generated by installing a minimal R package with
R CMD INSTALL; its gzip.rdxand zlib.rdbpair verifies open, lookup, record reading, and payload parsing under--no-default-features --features lazyload. The existing hex oracle helper is also adjusted for the latest Clippy lint while retaining the workspace MSRV.Validation:
cargo fmt --all --checkcargo test --workspace --all-targets --all-features --lockedcargo clippy --workspace --all-targets --all-features --locked -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features --lockedcargo test -p rd-rds --no-default-features --features lazyload --locked