FakeDatabaseProvider

A real DatabaseProvider that uses an in-memory database for testing.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var beforeWithDb: suspend () -> Unit

Optional barrier/fault hook used to prove overlapping repository writes before they enter Room.

Link copied to clipboard
open override val currentDb: StateFlow<MeshtasticDatabase>

Functions

Link copied to clipboard
fun close()
Link copied to clipboard
open override fun <T> observeCurrentDb(query: (MeshtasticDatabase) -> Flow<T>): Flow<T>
Link copied to clipboard

Simulates the active-DB switch that happens when the app selects a different device — the new DB has no rows, so any cache that lived only in the previous DB is gone. Closes the prior DB to free its resources.

Link copied to clipboard
open suspend override fun <T> withDb(block: suspend (MeshtasticDatabase) -> T): T?
Link copied to clipboard
open suspend override fun <T> withReadDb(block: suspend (MeshtasticDatabase) -> T): T