exosql v0.2.37 ExoSQL.Expr View Source

Expression executor.

Requires a simplified expression from simplify_expr_columns that converts columns names to column positions, and then use as:

iex> row = [1,2,3,4,5]
  iex> expr = {:op, {"*", {:column, 1}, {:column, 2}}}
  iex> ExoSQL.Expr.run_expr(expr, row)
  6

Link to this section Summary

Functions

Try to return matching types

Try to simplify expressions

Link to this section Functions

Try to return matching types.

  • If any is datetime, return datetimes
  • If any is number, return numbers
  • Otherwise, as is

Try to simplify expressions.

Will return always a valid expression.

If any subexpression is of any of these types, the expression will be the maximum complxity.

This makes for example to simplify:

{:list, [lit: 1, lit: 2]} -> {:lit, [1,2]}