Anton Anton - 2 years ago 143
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download