Macro graphql_starter::sqlx_query_paginated_as

source ·
macro_rules! sqlx_query_paginated_as {
    ($page:ident, $executor:expr, [$($cols:ident $(. $order:ident())? : $ty:path),*], $out_struct:path, $query:expr) => { ... };
    ($page:ident, $executor:expr, [$($cols:ident $(. $order:ident())? : $ty:path),*], $out_struct:path, $query:expr, $($args:tt)*) => { ... };
    (
        columns = [$($cols:ident $(. $order:ident())? : $ty:path),*],
        page = $page:ident,
        executor = $executor:expr,
        record = $out_struct:path,
        query = $query:expr,
        args = [$($args:expr),*]
    ) => { ... };
}
Expand description

Similar to sqlx::query_as! but with pagination capabilities.

Note: this macro won’t populate total_items in the resulting page, it must be queried afterwards if needed.