Skip to content

Export the keyset! macro for peer repository crates - #313

Merged
martsokha merged 1 commit into
mainfrom
chore/export-keyset-macro
Sep 18, 2026
Merged

martsokha merged 1 commit into
mainfrom
chore/export-keyset-macro

Conversation

@martsokha

@martsokha martsokha commented Sep 18, 2026

Copy link
Copy Markdown
Member

keyset! (the shared keyset-pagination helper for cursor listings) 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 helper for its own cursor-paginated queries, so this makes it #[macro_export] — callable as nvisy_postgres::keyset!.

Why this is a clean export

  • The macro already references Direction by its absolute $crate::types::Direction path (publicly reachable), so a peer crate needs no extra import for it.
  • It expands only to Diesel query-builder calls, so the sole requirement at a call site is diesel::prelude::* in scope.
  • nvisy-cloud-postgres is a peer of nvisy-postgres (another repository/query layer), not an upper layer, so exporting query-layer infrastructure to it doesn't cross the handler → domain → query boundary.

Compatibility

The existing pub(crate) use re-export chain (cursorpaginationtypes) 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 doc clean; nvisy-postgres cursor tests pass. One-line change (visibility only), no behavior change.

🤖 Generated with Claude Code

https://claude.ai/code/session_018bKk1YEG4tZ69jzYVQvQL8

Summary by CodeRabbit

  • Documentation
    • Expanded documentation for the keyset pagination macro, including usage requirements and guidance for referencing pagination direction values.

`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.
@martsokha martsokha added chore maintenance, dependency updates, code cleanup postgres ORM, models, queries, migrations labels Sep 18, 2026
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: 6c8c3a5f-cf31-4d79-b0f1-3107ad969431

📥 Commits

Reviewing files that changed from the base of the PR and between ef5e15c and 6fa74ed.

📒 Files selected for processing (1)
  • crates/nvisy-postgres/src/types/pagination/cursor.rs

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.


📝 Walkthrough

Walkthrough

The keyset! macro documentation now explains peer-crate availability, the required diesel::prelude::* import, and absolute Direction path resolution.

Changes

Keyset Macro Documentation

Layer / File(s) Summary
Document macro usage
crates/nvisy-postgres/src/types/pagination/cursor.rs
The exported keyset! macro documentation now describes peer-crate use, Diesel prelude requirements, and the absolute Direction path.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 6fa74

This documentation update does not introduce a current production or integration risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: exporting the keyset! macro for use by peer repository crates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@martsokha martsokha self-assigned this Sep 18, 2026
@martsokha
martsokha merged commit f79229b into main Sep 18, 2026
9 checks passed
@martsokha
martsokha deleted the chore/export-keyset-macro branch September 18, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore maintenance, dependency updates, code cleanup postgres ORM, models, queries, migrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant