Hm; that's complicated. I refactored all my repo f...
# squarelibraries
p
Hm; that's complicated. I refactored all my repo functions to be presented by an
sealed class Action
. Now I have sth like:
Copy code
suspend fun run(actions : List<Action>){
    withContext(<http://Dispatchers.IO|Dispatchers.IO>){
      db.transaction {
        actions.forEach { action ->
          when (action) {
            is Action.Delete -> queries ...
          }
        }
      }
    }
  }
Does that make sense?
d
You run the transactions on the main thread?
p
Nope just a quick-prototype error