Macro sqlx_expand_paginated_query

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

Similar to sqlx::expand_query! but includes pagination capabilities.

Input parameters:

  • record = Type (mandatory): The type of the retrieved record
  • query = String (mandatory): The query to be executed
  • args = [Expr] (optional): The arguments to query
  • extra_row = bool (optional): Wether to return an extra row or not (useful to determine if there’s a previous/next page)
  • columns = [Ident] (mandatory): The columns to order by, each row should be uniquely identified by this combination of columns.
    • The ordering can also be specified and defaults to asc. For example [timestamp.desc(), id.asc()]
  • first = Expr (optional): The number of rows to return for forward pagination
  • last = Expr (optional): The number of rows to return for backward pagination
  • after = Expr (optional): The variable for a tuple with the values of the cursor for the columns in the same order when forward paginating
  • before = Expr (optional): The variable for a tuple with the values of the cursor for the columns in the same order when backward paginating