Expand description
The Query represents a Toql query but also comes with query builder methods.
While it’s perfectly possible to use the query builder directly
it is recommended to use the query!
macro. However sometimes
mixed uses of the macro and the builder may make sense.
Example
ⓘ
use toql::prelude::{Query, Field};
let q = Query::<FooBar>::new()
.and(Field::from("foo").hide().eq(5).asc(1))
.and(Field::from("bar").desc(2));
assert_eq!("+1.foo EQ 5,-2bar", q.to_string());
The above code generated with the query! macro
ⓘ
use toql::prelude::{Query, Field};
let q :Query<FooBar>= query!(FooBar, "+1.foo EQ 5, -2bar");
assert_eq!("+1.foo EQ 5,-2bar", q.to_string());
The query macro produces a Query type, so the result can modified with builder functions.
Modules
Structs
Functions
Asserts that the provided roles contains all required roles. The first missing role is returned as error.