Export the keyset! macro for peer repository crates - #313
Conversation
`keyset!` was `pub(crate)`, usable only within nvisy-postgres. The cloud server's nvisy-cloud-postgres crate has its own repository layer and needs the same keyset-pagination helper, so make it `#[macro_export]` (callable as `nvisy_postgres::keyset!`). The macro already references `Direction` by its absolute `$crate` path and only expands to Diesel query-builder calls, so a peer crate needs just `diesel::prelude::*` in scope. The existing `pub(crate) use` re-export chain is kept, so in-crate call sites are unchanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe ChangesKeyset Macro Documentation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Feature Merge Risk: ⚪ Minimal · up to This documentation update does not introduce a current production or integration risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
keyset!(the shared keyset-pagination helper for cursor listings) waspub(crate), usable only withinnvisy-postgres. The cloud server'snvisy-cloud-postgrescrate has its own repository layer and needs the same helper for its own cursor-paginated queries, so this makes it#[macro_export]— callable asnvisy_postgres::keyset!.Why this is a clean export
Directionby its absolute$crate::types::Directionpath (publicly reachable), so a peer crate needs no extra import for it.diesel::prelude::*in scope.nvisy-cloud-postgresis a peer ofnvisy-postgres(another repository/query layer), not an upper layer, so exporting query-layer infrastructure to it doesn't cross thehandler → domain → queryboundary.Compatibility
The existing
pub(crate) usere-export chain (cursor→pagination→types) is kept, so in-crate call sites (use crate::types::keyset;) are unchanged.Verification
cargo check/clippy --all-targets -D warnings/+nightly fmt --check/RUSTDOCFLAGS=-D warnings cargo docclean;nvisy-postgrescursor tests pass. One-line change (visibility only), no behavior change.🤖 Generated with Claude Code
https://claude.ai/code/session_018bKk1YEG4tZ69jzYVQvQL8
Summary by CodeRabbit