2020-06-12 15:44:45 +02:00
|
|
|
package at.connyduck.pixelcat.db
|
|
|
|
|
2020-06-12 19:58:15 +02:00
|
|
|
import androidx.room.Dao
|
|
|
|
import androidx.room.Delete
|
|
|
|
import androidx.room.Insert
|
|
|
|
import androidx.room.OnConflictStrategy
|
|
|
|
import androidx.room.Query
|
2020-06-12 15:44:45 +02:00
|
|
|
import at.connyduck.pixelcat.db.entitity.AccountEntity
|
|
|
|
|
|
|
|
@Dao
|
|
|
|
interface AccountDao {
|
|
|
|
|
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
|
|
suspend fun insertOrReplace(account: AccountEntity): Long
|
|
|
|
|
|
|
|
@Delete
|
|
|
|
suspend fun delete(account: AccountEntity)
|
|
|
|
|
|
|
|
@Query("SELECT * FROM AccountEntity ORDER BY id ASC")
|
|
|
|
suspend fun loadAll(): List<AccountEntity>
|
|
|
|
}
|