exosql v0.2.88 ExoSQL.Expr View Source
Expression executor.
Requires a simplified expression from ExoSQL.Expr.simplify that converts
columns names to column positions, and then use as:
iex> context = %{ row: [1,2,3,4,5] }
iex> expr = {:op, {"*", {:column, 1}, {:column, 2}}}
iex> ExoSQL.Expr.run_expr(expr, context)
6
Link to this section Summary
Functions
Unifies equal comparison
Unifies is greater comparison
Unifies greater or equal comparison
Try to return matching types
Simplify the column ids to positions on the list of columns, to ease operations
Link to this section Functions
Link to this function
is_equal(r1, r2) View Source
Unifies equal comparison
Link to this function
is_greater(r1, r2) View Source
Unifies is greater comparison
Link to this function
is_greater_or_equal(r1, r2) View Source
Unifies greater or equal comparison
Link to this function
like(str, str) View Source
Link to this function
match_types(a, b) View Source
Try to return matching types.
- If any is datetime, return datetimes
- If any is number, return numbers
- Otherwise, as is
Link to this function
run_expr(arg, context) View Source
Link to this function
simplify(list, context) View Source
Simplify the column ids to positions on the list of columns, to ease operations.
This operation is required to change expressions from column names to column
positions, so that ExoSQL.Expr can perform its operations on rows.