New expressions
zachdaniel:
Iām adding four new expressions now, and one was added recently by <@258473836675072000> (
string_join
) so I thought Iād call them out here.
string_join/1
- join a list into a string, i.e
string_join(["foo", "bar"]) => "foobar"
string_join/2
- join a list into a string with a joiner, i.e
string_join(", ", ["foo", "bar"]) => "foo, bar"
datetime_add/3
- add an interval to a datetime, i.e
datetime_add(^datetime, 1, :hour)
date_add/3
- add an interval to a date, i.e
date_add(^date, 3, :day)
from_now/2
- add an interval to the current datetime, i.e
from_now(3, :day)
(the opposite of the
ago
expression)
today
- The equivalent of
now()
but produces the current date.
jharton:
Nice!
zachdaniel:
Ash release is out, ash_postgres release will be going out soon with pg support
frankdugan3:
Nice, these are great and will really clean some stuff up! š
kernel_io:
Iām assuming string_join/2 will use ws_concat right?
dblack1:
concat_ws, or concat, depending if you provide a separator
kernel_io:
ššæ