From 6fa74ed63d571bf549b91831321daaee19cda09f Mon Sep 17 00:00:00 2001 From: Oleh Martsokha Date: Fri, 18 Sep 2026 14:47:20 +0200 Subject: [PATCH] Export the keyset! macro for peer repository crates `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. --- crates/nvisy-postgres/src/types/pagination/cursor.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/nvisy-postgres/src/types/pagination/cursor.rs b/crates/nvisy-postgres/src/types/pagination/cursor.rs index 74ad22b3..5645e266 100644 --- a/crates/nvisy-postgres/src/types/pagination/cursor.rs +++ b/crates/nvisy-postgres/src/types/pagination/cursor.rs @@ -220,7 +220,13 @@ impl CursorPage { /// value — nothing here assumes a timestamp. `direction` is a [`Direction`]; /// `after` is typically `pagination.after_key().map(|k| (k.field.into(), k.id))`. /// +/// Exported for peer repository crates (e.g. `nvisy-cloud-postgres`) that build +/// their own keyset queries; it expands to Diesel query-builder calls, so the +/// call site needs `diesel::prelude::*` in scope. `Direction` is referenced by +/// its absolute path, so no import of it is required. +/// /// [`Direction`]: crate::types::Direction +#[macro_export] macro_rules! keyset { ($query:expr, $sort:expr, $id:expr, $direction:expr, $after:expr) => {{ use $crate::types::Direction;