Novo Dimaporo
04/23/2025, 5:44 AM@Dao
interface EntityDao {
@Transaction
fun transaction(block: () -> Unit) {
block()
}
}
And expose this to the repository layer then the usecase.rattleshirt
04/30/2025, 9:13 AMrattleshirt
04/30/2025, 9:14 AMrattleshirt
04/30/2025, 9:16 AMrattleshirt
04/30/2025, 9:19 AMNovo Dimaporo
04/30/2025, 9:20 AMrattleshirt
04/30/2025, 9:23 AMNovo Dimaporo
04/30/2025, 9:24 AMsuspend fun writeTransaction(block: suspend () -> Unit) {
db.useWriterConnection { transactor ->
transactor.immediateTransaction {
block()
}
}
}