Is there a way to run raw sql with Kotlin's Exposed library

pondermatic picture pondermatic · Dec 5, 2016 · Viewed 8.9k times · Source

I'm trying to run some sql specific to postgres and would like to reuse the transaction management within Exposed.

Answer

Kiskae picture Kiskae · Dec 6, 2016

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