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 eitherLimitClause
(forAll
andStream
) or a simpleu64
(forOne
andOptional
).transaction
: Optional transaction to execute the query on.