Function rorm_db::database::query

source ·
pub fn query<'result, 'db: 'result, 'post_query: 'result, Q: QueryStrategy + GetLimitClause>(
    executor: impl Executor<'db>,
    model: &str,
    columns: &[ColumnSelector<'_>],
    joins: &[JoinTable<'_, 'post_query>],
    conditions: Option<&Condition<'post_query>>,
    order_by_clause: &[OrderByEntry<'_>],
    limit: Option<Q::LimitOrOffset>
) -> Q::Result<'result>
Expand description

This method is used to retrieve rows that match the provided query.

It is generic over a QueryStrategy which specifies how and how many rows to query.

Parameter:

  • model: Model to query.
  • columns: Columns to retrieve values from.
  • joins: Join tables expressions.
  • conditions: Optional conditions to apply.
  • limit: Optional limit / offset to apply to the query. Depending on the query strategy, this is either LimitClause (for All and Stream) or a simple u64 (for One and Optional).
  • transaction: Optional transaction to execute the query on.