1

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(…).

scand1sk
  • 1,114
  • 11
  • 25

1 Answers1

1

Not supported right now. We have a PR in the queue. Probably arrives in 2.1 . https://github.com/slick/slick/pull/213

cvogt
  • 11,260
  • 30
  • 46