exosql v0.2.19 ExoSQL.Builtins View Source

Builtin functions.

There are two categories, normal functions and aggregate functions. Aggregate functions receive as first parameter a ExoSQL.Result with a full table, and the rest of parameters are the function calling parameters, unsolved.

These expressions must be first simplified with ExoSQL.executor.simplify_expr_columns and then executed on the rows with ExoSQL.Expr.run_expr.

Link to this section Summary

Link to this section Functions

Link to this function call_function(name, args) View Source

Very simple sprintf formatter. Knows this formats:

  • %%
  • %s
  • %d
  • %f (only two decimals)
  • %.{ndec}f
Link to this function format(str, arg1, arg2, arg3) View Source
Link to this function format(str, arg1, arg2, arg3, arg4) View Source
Link to this function format(str, arg1, arg2, arg3, arg4, arg5) View Source
Link to this function format(str, arg1, arg2, arg3, arg4, arg5, arg6) View Source
Link to this function format(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7) View Source
Link to this function format(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) View Source
Link to this function format(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) View Source
Link to this function if_(cond_, then_, else_ \\ nil) View Source

Convert datetime to string.

If no format is given, it is as to_string, which returns the ISO 8601. Format allows all substitutions from Timex.format, for example:

%d day of month: 00 %H hour: 00-24 %m month: 01-12 %M minute: 00-59 %s seconds since 1970-01-01 %S seconds: 00-59 %Y year: 0000-9999 %i ISO 8601 format %V Week number %% %