bod
06/11/2025, 9:41 AMgenerateAsync.set(true)
. Any call to driver.executeQuery()
should be migrated to driver.awaitQuery()
, right?
But this doesn't seem to work with a non-async driver such as the JDBC one on the JVM. For instance I'm doing this:
driver.awaitQuery(
null,
"PRAGMA $versionPragma",
{ cursor ->
// The cursor is already closed here
if (cursor.next().await()) {
cursor.getLong(0)
} else {
null
}
},
0
)
using the debugger I can see that my lambda is called after the statement has already been closed which obviously cannot work.
I must be missing something obvious? 🤔
Other extensions like awaitAsOneOrNull()
seem to work as expected.jw
06/11/2025, 12:00 PMjw
06/11/2025, 12:00 PMbod
06/11/2025, 12:04 PMQuery(
0,
arrayOf(),
driver,
"",
"",
"my query") { cursor ->
// ...
}.awaitAsList()
This works, but seems a bit awkward maybe?