Backup & Restore for custom attributes

This commit is contained in:
MM20
2022-07-27 21:08:07 +02:00
parent 2e3add0d94
commit f069d5f6f4
10 changed files with 102 additions and 6 deletions
@@ -4,6 +4,7 @@ import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import de.mm20.launcher2.database.entities.CustomAttributeEntity
import de.mm20.launcher2.database.entities.FavoritesItemEntity
import de.mm20.launcher2.database.entities.WebsearchEntity
import de.mm20.launcher2.database.entities.WidgetEntity
@@ -37,4 +38,13 @@ interface BackupRestoreDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun importWebsearches(items: List<WebsearchEntity>)
@Query("DELETE FROM CustomAttributes")
suspend fun wipeCustomAttributes()
@Query("SELECT * FROM CustomAttributes LIMIT :limit OFFSET :offset")
suspend fun exportCustomAttributes(limit: Int, offset: Int): List<CustomAttributeEntity>
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun importCustomAttributes(items: List<CustomAttributeEntity>)
}