1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-10 04:52:38 +01:00

Change dependencies and add back suspensions

This commit is contained in:
Allan Wang 2019-03-05 18:52:47 -05:00
parent e82b74a687
commit 8841728780
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
3 changed files with 10 additions and 10 deletions

View File

@ -258,8 +258,8 @@ dependencies {
implementation "com.sothree.slidinguppanel:library:${SLIDING_PANEL}"
implementation "androidx.room:room-coroutines:${ROOM}"
implementation "android.arch.persistence.room:runtime:${ROOM}"
kapt "android.arch.persistence.room:compiler:${ROOM}"
implementation "androidx.room:room-runtime:${ROOM}"
kapt "androidx.room:room-compiler:${ROOM}"
testImplementation "androidx.room:room-testing:${ROOM}"
}

View File

@ -60,16 +60,16 @@ data class CookieEntity(
interface CookieDao {
@Query("SELECT * FROM cookies")
fun selectAll(): List<CookieEntity>
suspend fun selectAll(): List<CookieEntity>
@Query("SELECT * FROM cookies WHERE id = :id")
fun selectById(id: Long): CookieEntity?
suspend fun selectById(id: Long): CookieEntity?
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertCookie(cookie: CookieEntity)
suspend fun insertCookie(cookie: CookieEntity)
@Query("DELETE FROM cookies WHERE id = :id")
fun deleteById(id: Long)
suspend fun deleteById(id: Long)
}
@Database(version = CookiesDb.VERSION)

View File

@ -45,16 +45,16 @@ data class FbTabEntity(@androidx.room.PrimaryKey var position: Int, var tab: FbI
interface FbTabDao {
@Query("SELECT * FROM tabs ORDER BY position ASC")
fun _selectAll(): List<FbTabEntity>
suspend fun _selectAll(): List<FbTabEntity>
@Query("DELETE FROM tabs")
fun _deleteAll()
suspend fun _deleteAll()
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun _insertAll(items: List<FbTabEntity>)
suspend fun _insertAll(items: List<FbTabEntity>)
@Transaction
fun _save(items: List<FbTabEntity>) {
suspend fun _save(items: List<FbTabEntity>) {
_deleteAll()
_insertAll(items)
}