ufoss-org / kotysa

The idiomatic way to write type-safe SQL in Kotlin
The Unlicense
117 stars 1 forks source link

Error on update statement #119

Closed Metis-Adrastea closed 1 year ago

Metis-Adrastea commented 1 year ago
Exception in thread "DefaultDispatcher-worker-8" java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
    at org.ufoss.kotysa.r2dbc.SqlClientUpdateR2dbc$Return.execute$suspendImpl(SqlClientUpdateR2dbc.kt:87)
    at org.ufoss.kotysa.r2dbc.SqlClientUpdateR2dbc$Return$execute$1.invokeSuspend(SqlClientUpdateR2dbc.kt)

org.ufoss.kotysa.r2dbc.SqlClientUpdateR2dbc.Return#execute return Int, but last row in block result.rowsUpdated.awaitSingle() return Long Publisher getRowsUpdated(); io.r2dbc.spi.Result

dependencies {
    implementation("org.ufoss.kotysa:kotysa-r2dbc-coroutines:2.3.1")
    implementation("io.r2dbc:r2dbc-pool:1.0.0.RELEASE")
    implementation("org.postgresql:r2dbc-postgresql:1.0.0.RELEASE")
}
pull-vert commented 1 year ago

Hello @Metis-Adrastea This error is because you are using R2DBC 1.0.0. For now Kotysa uses R2DBC 0.9.x, there are some breaking changes since. Please wait for Kotysa 3.0.0 for R2DBC 1.0.x compatibility, see #113

pull-vert commented 1 year ago

Hi @Metis-Adrastea
Kotysa 3.0.0 is released, it is compatible with R2DBC 1.0.0 !