I am struggling to use CURRENT_DATE from PostgreSQL with Slick lifted embedding. I want to use it as a default value for a column, and to use it for calculating delays:
CREATE TABLE Test(id serial PRIMARY KEY, updated date DEFAULT CURRENT_DATE);
SELECT * FROM Test WHERE CURRENT_DATE - updated > 8;
are both valid SQL commands with PostgreSQL. How can I emulate them with Slick Lifted embedding? I tried to declare this in Scala:
def current_date = SimpleFunction.nullary[java.sql.Date]("CURRENT_DATE")
However, this returns a Column[Date]
although O.Default(…)
expects a Date
, and it does not recognize the -
operation in filter(…)
.