how do I execute queries that looks like this using scala Quill library?
REFRESH MATERIALIZED VIEW CONCURRENTLY transaction_view
how do I execute queries that looks like this using scala Quill library?
REFRESH MATERIALIZED VIEW CONCURRENTLY transaction_view
Basically this can be archived by writing it in a quote
val q = quote { query[MyTable] }
val myQuery = quote { infix"REFRESH MATERIALIZED VIEW CONCURRENTLY {$q}".as[Query[MyTable]] }
Thanks to @deusaquilus
The answer from binkabir is almost correct. One last touch needed is to replace Query with Action, otherwise Quill will again generate a select, instead of just using the raw string.
val q = quote { query[MyTable] }
val myQuery = quote { infix"REFRESH MATERIALIZED VIEW CONCURRENTLY {$q}".as[Action[MyTable]] }