-1

how do I execute queries that looks like this using scala Quill library?

REFRESH MATERIALIZED VIEW CONCURRENTLY transaction_view

binkabir
  • 144
  • 1
  • 6

2 Answers2

0

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

binkabir
  • 144
  • 1
  • 6
0

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]] }
Skarpi
  • 1
  • 3