fexpr
Types
A node in a fexpr expression tree.
pub type FexprNode {
None
Wrap(FexprNode)
Fexpr(field: String, operator: Operator, value: FexprValue)
OrBinOp(left: FexprNode, right: FexprNode)
AndBinOp(left: FexprNode, right: FexprNode)
}
Constructors
-
None -
Wrap(FexprNode) -
Fexpr(field: String, operator: Operator, value: FexprValue) -
-
pub type FexprValue {
String(String)
Int(Int)
Float(Float)
Bool(Bool)
Null
DateTime(birl.Time)
Array(List(FexprValue))
}
Constructors
-
String(String) -
Int(Int) -
Float(Float) -
Bool(Bool) -
Null -
DateTime(birl.Time) -
Array(List(FexprValue))
The operators that can be used in a (pocketbase) fexpr expression.
pub type Operator {
Equal
NotEqual
Greater
GreaterOrEqual
Less
LessOrEqual
Contains
NotContains
AtLeastOneEqual
AtLeastOneNotEqual
AtLeastOneGreater
AtLeastOneGreaterOrEqual
AtLeastOneLess
AtLeastOneLessOrEqual
AtLeastOneContains
AtLeastOneNotContains
}
Constructors
-
Equal -
NotEqual -
Greater -
GreaterOrEqual -
Less -
LessOrEqual -
Contains -
NotContains -
AtLeastOneEqual -
AtLeastOneNotEqual -
AtLeastOneGreater -
AtLeastOneGreaterOrEqual -
AtLeastOneLess -
AtLeastOneLessOrEqual -
AtLeastOneContains -
AtLeastOneNotContains
Values
pub fn and(
fexpr: FexprNode,
field: String,
operator: Operator,
value: FexprValue,
) -> FexprNode
Create a fexpr node that is the logical AND of the given fexpr node and a new fexpr node with the given field, operator and value.
pub fn and_builder(
fexpr: FexprNode,
other: FexprNode,
) -> FexprNode
Create a fexpr node that is the logical AND of the two given fexpr nodes.
pub fn decode_any_float() -> decode.Decoder(Float)
Creates a decoder for the Number type.
pub fn decode_any_int() -> decode.Decoder(Int)
Creates a decoder for the Number type.
pub fn decoder_of_fexpr_value(
value: FexprValue,
) -> decode.Decoder(FexprValue)
pub fn dual(
field_a: String,
field_b: String,
operator: Operator,
value_a: FexprValue,
value_b: FexprValue,
) -> FexprNode
pub fn fexpr(
field: String,
operator: Operator,
value: FexprValue,
) -> FexprNode
Create a fexpr node with the given field, operator and value.
pub fn fexpr_value_compare(
a: FexprValue,
b: FexprValue,
) -> Result(order.Order, Nil)
pub fn fexpr_value_to_json(value: FexprValue) -> json.Json
pub fn fexpr_value_to_sql_string(value: FexprValue) -> String
pub fn fexpr_value_to_string(value: FexprValue) -> String
pub fn or(
fexpr: FexprNode,
field: String,
operator: Operator,
value: FexprValue,
) -> FexprNode
Create a fexpr node that is the logical OR of the given fexpr node and a new fexpr node with the given field, operator and value.
pub fn or_builder(
fexpr: FexprNode,
other: FexprNode,
) -> FexprNode
Create a fexpr node that is the logical OR of the two given fexpr nodes.
pub fn to_string(node: FexprNode) -> String
Convert the given fexpr node to its string representation.
pub fn verify_fexpr(fexpr: FexprNode, data: String) -> Bool
pub fn verify_fexpr_dyn(
fexpr: FexprNode,
data: dynamic.Dynamic,
) -> Bool