From ee9a9a696420d5da05b4f306898fff29e9abe1a4 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 5 Mar 2019 18:44:18 -0500 Subject: Create working dao without suspension --- app/src/main/kotlin/com/pitchedapps/frost/db/CookiesDb.kt | 8 ++++---- app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/db') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/db/CookiesDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/db/CookiesDb.kt index 9deb57da..0b8283fd 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/db/CookiesDb.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/db/CookiesDb.kt @@ -60,16 +60,16 @@ data class CookieEntity( interface CookieDao { @Query("SELECT * FROM cookies") - suspend fun selectAll(): List + fun selectAll(): List @Query("SELECT * FROM cookies WHERE id = :id") - suspend fun selectById(id: Long): CookieEntity? + fun selectById(id: Long): CookieEntity? @Insert(onConflict = OnConflictStrategy.REPLACE) - suspend fun insertCookie(cookie: CookieEntity) + fun insertCookie(cookie: CookieEntity) @Query("DELETE FROM cookies WHERE id = :id") - suspend fun deleteById(id: Long) + fun deleteById(id: Long) } @Database(version = CookiesDb.VERSION) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt b/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt index 2e2a9d62..ab01e025 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/db/FbTabsDb.kt @@ -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") - suspend fun _selectAll(): List + fun _selectAll(): List @Query("DELETE FROM tabs") - suspend fun _deleteAll() + fun _deleteAll() @Insert(onConflict = OnConflictStrategy.REPLACE) - suspend fun _insertAll(items: List) + fun _insertAll(items: List) @Transaction - suspend fun _save(items: List) { + fun _save(items: List) { _deleteAll() _insertAll(items) } -- cgit v1.2.3