Derive Macro Queryable

Source
#[derive(Queryable)]
{
    // Attributes available to this derive:
    #[table]
    #[where_clause]
    #[select]
    #[join]
    #[group_by]
    #[order_by]
    #[having]
    #[limit]
    #[offset]
}
Expand description

Derive macro for generating SELECT queries.

§Attributes

  • table: The name of the table to select from
  • where_clause: The WHERE clause for the SELECT statement
  • select: The columns to select (optional)
  • join: JOIN clauses (optional)
  • group_by: GROUP BY clause (optional)
  • order_by: ORDER BY clause (optional)
  • having: HAVING clause (optional)
  • limit: LIMIT clause (optional)
  • offset: OFFSET clause (optional)