pub struct ExpressionBuilder<'a> { /* private fields */ }Expand description
Builds the conditions of a where (ExpressionBuilder in
packages/zql/src/query/expression.ts).
Implementations§
Source§impl<'a> ExpressionBuilder<'a>
impl<'a> ExpressionBuilder<'a>
Sourcepub fn cmp(
&self,
field: impl Into<String>,
op: SimpleOperator,
value: impl Into<Value>,
) -> Condition
pub fn cmp( &self, field: impl Into<String>, op: SimpleOperator, value: impl Into<Value>, ) -> Condition
field compares to value by op.
Sourcepub fn cmp_param(
&self,
field: impl Into<String>,
op: SimpleOperator,
param: &StaticParameter,
) -> Condition
pub fn cmp_param( &self, field: impl Into<String>, op: SimpleOperator, param: &StaticParameter, ) -> Condition
field compares to a value of the context by op.
Sourcepub fn json(
&self,
column: impl Into<String>,
path: Vec<JsonPathSegment>,
) -> JsonPathReference
pub fn json( &self, column: impl Into<String>, path: Vec<JsonPathSegment>, ) -> JsonPathReference
A value inside the json column column, for Self::cmp_json:
path is object keys and array indices, applied in order. At least
one segment is needed, and an index must be at most
MAX_JSON_PATH_INDEX.
Sourcepub fn cmp_json(
&self,
reference: &JsonPathReference,
op: SimpleOperator,
value: impl Into<Value>,
) -> Condition
pub fn cmp_json( &self, reference: &JsonPathReference, op: SimpleOperator, value: impl Into<Value>, ) -> Condition
Compares the value at a JSON path with a value of the same JSON type;
a value of another type never equals it. An IN list must hold
values of one type.
Sourcepub fn cmp_json_param(
&self,
reference: &JsonPathReference,
op: SimpleOperator,
param: &StaticParameter,
) -> Condition
pub fn cmp_json_param( &self, reference: &JsonPathReference, op: SimpleOperator, param: &StaticParameter, ) -> Condition
The value at the JSON path compares to a value of the context by op.
Sourcepub fn cmp_lit(
&self,
left: impl Into<Value>,
op: SimpleOperator,
right: impl Into<Value>,
) -> Condition
pub fn cmp_lit( &self, left: impl Into<Value>, op: SimpleOperator, right: impl Into<Value>, ) -> Condition
Compares two literals, neither of them a column.
Sourcepub fn cmp_lit_param(
&self,
left: &StaticParameter,
op: SimpleOperator,
right: impl Into<Value>,
) -> Condition
pub fn cmp_lit_param( &self, left: &StaticParameter, op: SimpleOperator, right: impl Into<Value>, ) -> Condition
Compares a value of the context with a literal.
Auto Trait Implementations§
impl<'a> !Freeze for ExpressionBuilder<'a>
impl<'a> !RefUnwindSafe for ExpressionBuilder<'a>
impl<'a> !Sync for ExpressionBuilder<'a>
impl<'a> Forget for ExpressionBuilder<'a>
impl<'a> Move for ExpressionBuilder<'a>
impl<'a> Send for ExpressionBuilder<'a>
impl<'a> Unpin for ExpressionBuilder<'a>
impl<'a> UnsafeUnpin for ExpressionBuilder<'a>
impl<'a> UnwindSafe for ExpressionBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more