Note Dao
Functions
Deletes a note from the 'notes' table. The note is identified by its primary key. This is a suspend function, designed for asynchronous execution.
Retrieves all active (not soft-deleted) notes from the 'notes' table. Active notes are those where the 'isDeleted' flag is 0 (false). The results are ordered by timestamp in descending order (newest first).
Retrieves all notes from the 'notes' table, ordered by timestamp in descending order (newest first). This method returns a Flow of a list of notes. The Flow will automatically emit a new list whenever the data in the 'notes' table changes, allowing the UI to reactively update.
Retrieves all soft-deleted notes from the 'notes' table. Deleted notes are those where the 'isDeleted' flag is 1 (true). The results are ordered by timestamp in descending order (newest first).
Inserts a new note into the 'notes' table. If a note with the same primary key already exists, it will be replaced due to onConflict = OnConflictStrategy.REPLACE
. This is a suspend function, meaning it should be called from a coroutine or another suspend function to perform the operation asynchronously.
Updates an existing note in the 'notes' table. The note is identified by its primary key. This is a suspend function, designed for asynchronous execution.