Alexander Weickmann
09/23/2019, 1:26 PMval launchResult = suspendedTransactionAsync(<http://Dispatchers.IO|Dispatchers.IO>, db = db) {
FooTable.selectAll().count()
}.andThen { count ->
BarTable.select { BarTable.value eq count }.map { it[BarTable.name] }
}
here it seems that the result of the count is only available to the remaining code when passed via andThen function. when exactly is it necessary to use the andThen function?
would this not work?
val launchResult = suspendedTransactionAsync(<http://Dispatchers.IO|Dispatchers.IO>, db = db) {
val count = FooTable.selectAll().count()
BarTable.select { BarTable.value eq count }.map { it[BarTable.name] }
}
tapac
09/23/2019, 4:57 PMAlexander Weickmann
09/25/2019, 4:15 PM