package com.github.nullptroma.wallenc.infrastructure.android.db.app.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.github.nullptroma.wallenc.infrastructure.android.db.app.model.DbStorageSyncGroup

@Dao
interface StorageSyncGroupDao {
    @Query("SELECT * FROM storage_sync_groups")
    suspend fun getAll(): List<DbStorageSyncGroup>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun upsert(group: DbStorageSyncGroup)

    @Query("DELETE FROM storage_sync_groups WHERE group_id = :groupId")
    suspend fun deleteById(groupId: String)
}
