Bartłomiej Kozak
09/02/2022, 5:51 PMsuspend fun <T> dbQuery(block: suspend () -> T): T = newSuspendedTransaction(<http://Dispatchers.IO|Dispatchers.IO>) { block() }
override suspend fun isEmailTaken(email: String): Boolean = dbQuery {
UserEntity.find {
UsersTable.email eq email
}.firstOrNull()
} == null
and
override suspend fun isEmailTaken(email: String): Boolean = dbQuery {
UserEntity.find {
UsersTable.email eq email
}.firstOrNull() == null
}
?
Should I check if the value exists in the another way?tapac
09/11/2022, 2:45 PMfirstOrNull() == null
with .none()
or .empty()