MessageDao

interface MessageDao

Data Access Object for Message entities.

Provides methods to query, insert, and delete messages in the Room database.

Functions

Link copied to clipboard
abstract suspend fun addMessage(m: Message)

Inserts a new message into the database.

Link copied to clipboard
abstract fun clearTable()

Deletes all messages from the database.

Link copied to clipboard
abstract fun delete(m: Message)

Deletes a single message from the database.

Link copied to clipboard
abstract suspend fun deleteAll(messages: List<Message>)

Deletes multiple messages from the database.

Link copied to clipboard
abstract fun getAll(): List<Message>

Retrieves all messages as a synchronous list.

Link copied to clipboard
abstract fun getAllFlow(): Flow<List<Message>>

Returns a flow of all messages.

Link copied to clipboard
abstract fun getChatMessagesFlow(chat: String): Flow<List<Message>>

Returns a flow of messages for a specific chat, ordered by date received ascending.

Link copied to clipboard
abstract fun getChatMessagesFlowMultipleNames(chatNames: List<String>): Flow<List<Message>>

Returns a flow of messages for multiple chat names, ordered by date received ascending.

Link copied to clipboard
abstract fun getChatMessagesSync(chat: String): List<Message>

Synchronously retrieves messages for a specific chat, ordered by date received ascending.