exosql v0.2.25 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
Functions
Very simple sprintf formatter. Knows this formats
Generates a table with the series of numbers as given. Use for histograms without holes
Gets the domain from the domain name
Performs a JSON Pointer search on JSON data
Convert datetime to string
Parses an URL and return some part of it
Returns to which bucket it belongs
Link to this section Functions
Very simple sprintf formatter. Knows this formats:
- %%
- %s
- %d
- %f (only two decimals)
- %.{ndec}f
Generates a table with the series of numbers as given. Use for histograms without holes.
Gets the domain from the domain name.
This means “google” from “www.google.com” or “google” from “www.google.co.uk”
The algorithm disposes the tld (.uk) and the skips unwanted names (.co). Returns the first thats rest, or a default that is originally the full domain name or then each disposed part.
Performs a JSON Pointer search on JSON data.
It just uses / to separate keys.
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 %% %
Parses an URL and return some part of it.
If not what is provided, returns a JSON object with:
- host
- port
- scheme
- path
- query
- user
If what is passed, it performs a JSON Pointer search (jp function).
It must receive a url with scheme://server or the result may not be well formed.
For example, for emails, just use “email://connect@serverboards.io” or similar.
Returns to which bucket it belongs.
Only numbers, but datetimes can be transformed to unix datetime.