https://kotlinlang.org logo
#exposed
Title
# exposed
t

Torbilicious

01/08/2019, 1:38 PM
Hi! I am trying to insert sample data into my mysql database. I am using the following code:
Copy code
SomeTable.batchInsert((0 until 1_000).toList()) { number ->
    this[SomeTable.type] = "some-type"
    this[SomeTable.data] = """{"foo":"$number"}"""
}
but for some reason exposed creates 1000 statements for this instead of one batch statement. Is this the intended behaviour, or am i missing something?
t

tapac

01/09/2019, 1:50 PM
Please look for
rewriteBatchedStatements
at jdbc driver documentation here https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html
14 Views