15 lines
307 B
Kotlin
15 lines
307 B
Kotlin
|
|
package com.example.myapplication
|
||
|
|
|
||
|
|
import androidx.room.Dao
|
||
|
|
import androidx.room.Insert
|
||
|
|
import androidx.room.Query
|
||
|
|
import kotlinx.coroutines.flow.Flow
|
||
|
|
|
||
|
|
@Dao
|
||
|
|
interface NoteDao {
|
||
|
|
@Insert
|
||
|
|
suspend fun insert(note: NoteEntity)
|
||
|
|
|
||
|
|
@Query("SELECT * FROM notes")
|
||
|
|
fun getAll(): Flow<List<NoteEntity>>
|
||
|
|
}
|