File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
frameworks/Kotlin/ktor/ktor-r2dbc/src/main/kotlin/org/jetbrains/ktor/benchmarks Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -137,11 +137,9 @@ fun Application.main() {
137137 Mono .usingWhen(dbConnFactory.create(), { connection ->
138138 val statement = connection.createStatement(UPDATE_QUERY )
139139 worldsUpdated.forEach { world ->
140- if (world.id != null && world.randomNumber != null ) {
141- statement.bind(0 , world.randomNumber)
142- statement.bind(1 , world.id)
143- statement.add()
144- }
140+ statement.bind(" $1" , world.randomNumber)
141+ statement.bind(" $2" , world.id)
142+ statement.add()
145143 }
146144 if (worldsUpdated.isNotEmpty()) {
147145 Mono .from(statement.execute())
@@ -159,7 +157,7 @@ private fun getWorld(
159157 dbConnFactory : ConnectionFactory , random : Random
160158): Mono <World > = Mono .usingWhen(dbConnFactory.create(), { connection ->
161159 Mono .from(connection.createStatement(WORLD_QUERY )
162- .bind(0 , random.nextInt(DB_ROWS ) + 1 )
160+ .bind(" $1 " , random.nextInt(DB_ROWS ) + 1 )
163161 .execute())
164162 .flatMap { r ->
165163 Mono .from(r.map { row, _ ->
You can’t perform that action at this time.
0 commit comments