Files
CloudSync/app/src/main/java/com/fabisahne/cloudsync/data/FolderPairDao.kt
Fabian Wolter 31bd2b1ceb feat: Initial Database stuff for FolderPairs
This commit adds the initial Database design to save and load `FolderPair`s locally
2026-02-23 17:05:47 +01:00

26 lines
639 B
Kotlin

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)
}