Anton Anton - 4 months ago 17
SQL Question

View SQL query in Slick

Is there a way to observe an SQL statement that will be generated by


For example, I have this:

val q = actions.filter(v => v.actionHash === hash && v.carriedAt > past)

Can I view its underlying raw SQL?


You can print the query statement as shown on the Slick documentation:

val invoker = q.invoker
val statement = q.selectStatement

For other type of statements look at insertStatement, deleteStatement and updateStatement.