Is there a way to run raw sql with Kotlin's Exposed library
With help from Kiskae's answer, I was able to run the raw sql with:
transaction {
val conn = TransactionManager.current().connection
val statement = conn.createStatement()
val query = "REFRESH MATERIALIZED VIEW someview"
statement.execute(query)
}
Exposed has the Transaction.exec(String)
method which probably does what you want. See https://github.com/JetBrains/Exposed/blob/master/exposed-tests/src/test/kotlin/org/jetbrains/exposed/sql/tests/mysql/MysqlTests.kt