Move transactions to domain layer
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
package be.simplenotes.persistance.transactions
|
||||
|
||||
import me.liuwj.ktorm.database.Database
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
internal class KtormTransactionService(private val database: Database) : TransactionService {
|
||||
override fun <T> use(block: () -> T) = database.useTransaction { block() }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package be.simplenotes.persistance.transactions
|
||||
|
||||
interface TransactionService {
|
||||
fun <T> use(block: () -> T): T
|
||||
}
|
||||
Reference in New Issue
Block a user