feat: Initial Database stuff for FolderPairs

This commit adds the initial Database design to save and load `FolderPair`s locally
This commit is contained in:
Fabian Wolter
2026-02-23 17:05:47 +01:00
parent f94d1ca930
commit 31bd2b1ceb
6 changed files with 139 additions and 6 deletions

View File

@@ -0,0 +1,26 @@
package com.fabisahne.cloudsync.data
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import kotlinx.coroutines.flow.Flow
@Dao
interface FolderPairDao {
@Query("SELECT * FROM folder_pairs ORDER BY createdAt DESC")
fun getAll(): Flow<List<FolderPair>>
@Query("SELECT * FROM folder_pairs WHERE id = :id")
suspend fun getById(id: Long): FolderPair?
@Insert
suspend fun insert(folderPair: FolderPair): Long
@Update
suspend fun update(folderPair: FolderPair)
@Delete
suspend fun delete(folderPair: FolderPair)
}