5.9 Query expressions
let top = from o in db.Order
where o.userId == uid && o.total > MIN_TOTAL
order by o.createdAt desc
skip page * PAGE_SIZE
take PAGE_SIZE
load(items)
let names = from u in users where u.active select u.name // in-memory List
let byRole = from u in users group by u.role into g select (g.key, g.count())- Form:
from x in source(where e)* (order by e (asc|desc)?, …)? (group by e into g)? (skip e)? (take e)? (load(field, …))? (select e)?. - Source
Table<T>(§12.8): the query is compiled to SQL at build time and executed with thedbeffect; the result isList<T>(orList<S>withselect). Expressions inwhere/order byMUST be translatable to SQL: fields, literals, parameters, arithmetic, comparisons,in,&& || !,starts_with,contains,lower; otherwise — a compile error. - Any other source
Iterable<T>: the query is evaluated in memory and returnsiter<T>(lazy).
Related diagnostics
See also
Source: docs/spec/oxl-standard.en.md