Skip to main content

query

Function query 

Source
pub fn query<T: ForLifetimeTable>(
    f: impl for<'scope> FnOnce(&mut Q<'scope>) -> T::Of<'scope>,
) -> Query<T::Of<'static>>
Expand description

Open a context allowing you to manipulate a query.

Inside you can use q.q(...) on as many Query<T> values as you wish, the result of each call can be thought of as each value the query yields.

You can think of this as cross joining each query together, to create inner joins or left joins, simply use Q::where_ and Query<T>::optional.

Unfortunately, rustc isn’t able to infer the return type of this function as there seems to be no good way to express that T::Of<'a> is the same type as T::Of<'b> modulo lifetimes.