package com.example.dtf.dao

import androidx.room.*
import com.example.dtf.models.User
import kotlinx.coroutines.flow.Flow

@Dao
interface UserDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(user: User)

    @Update
    suspend fun update(user: User)

    @Delete
    suspend fun delete(user: User)

    @Query("select * from user where user.id = :id")
    fun getById(id: Int): Flow<User>
}