Skip to main content

order_by

Macro order_by 

Source
order_by!() { /* proc-macro */ }
Expand description

prax::order_by! — schema-aware shape macro returning an OrderBy value. Accepts either a single { field: dir } block or a list of such blocks for multi-key sorts.

let newest_first = prax::order_by!(User, { created_at: desc });
let _ = prax::find_many!(client.user, {
    order_by: { created_at: desc },
});
// or as a list:
let by_active_then_email = prax::order_by!(User, [
    { active: desc },
    { email: asc },
]);