mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
preparing the migration to Room database
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
package com.simplemobiletools.notes.pro.interfaces
|
||||
|
||||
import androidx.room.Dao
|
||||
import androidx.room.Insert
|
||||
import androidx.room.OnConflictStrategy
|
||||
import androidx.room.Query
|
||||
import com.simplemobiletools.notes.pro.models.Note
|
||||
|
||||
@Dao
|
||||
interface NotesDao {
|
||||
@Query("SELECT * FROM notes")
|
||||
fun getNotes(): List<Note>
|
||||
|
||||
@Query("SELECT * FROM notes WHERE id = :id")
|
||||
fun getNoteWithId(id: Int): Note?
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun insertOrUpdate(note: Note): Long
|
||||
}
|
Reference in New Issue
Block a user