Is it possible to set sqlite pragma when using exp...
# exposed
a
Is it possible to set sqlite pragma when using exposed. I tried calling exec but it throws an exception "Query returns results"
t
Try to define custom statement:
Copy code
fun main() {
//...
transaction.exec(PragmaStatement("automatic_index"))
}

class PragmaStatement(val value: String) : Statement<Unit>(StatementType.OTHER, emptyList()) {
    override fun arguments(): Iterable<Iterable<Pair<IColumnType, Any?>>> = emptyList()

    override fun prepareSQL(transaction: Transaction): String = "PRAGMA $value"

    override fun PreparedStatement.executeInternal(transaction: Transaction): Unit? {
        this.executeUpdate()
        return null
    }

}
a
Thanks, I'll give that ago tomorrow. 😄 Looks promising very promising as I'd got as far as the fact it was using the UpdateStatement class and that throws the exception