MeshLogDao

interface MeshLogDao(source)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun deleteAll()
Link copied to clipboard
abstract suspend fun deleteLog(uuid: String)
Link copied to clipboard
abstract suspend fun deleteLogs(fromNum: Int, portNum: Int)
Link copied to clipboard
abstract suspend fun deleteLogsByUuid(uuids: List<String>)
Link copied to clipboard
open suspend fun deleteLogsByUuidAtomic(uuids: List<String>)

Atomically deletes all logs matching uuids, chunking internally to stay under SQLite's bind-parameter limit. The entire batch is all-or-nothing: a failure rolls back every chunk.

Link copied to clipboard
abstract suspend fun deleteOlderThan(cutoffTimestamp: Long)
Link copied to clipboard
abstract fun getAllLogs(maxItem: Int): Flow<List<MeshLog>>
Link copied to clipboard
abstract fun getAllLogsInReceiveOrder(maxItem: Int): Flow<List<MeshLog>>
Link copied to clipboard
abstract suspend fun getAllLogsSnapshot(): List<MeshLog>

Snapshot + IGNORE-insert used by DatabaseMerger to carry telemetry/position/traceroute history across transports. uuid is a unique string per row, so IGNORE is just belt-and-suspenders against a rare clash.

Link copied to clipboard
abstract fun getLogsFrom(fromNum: Int, portNum: Int, maxItem: Int): Flow<List<MeshLog>>

Retrieves MeshLogs matching 'from_num' (nodeNum) and 'port_num' (PortNum).

Link copied to clipboard
abstract suspend fun getLogsSnapshot(fromNum: Int, portNum: Int, maxItem: Int): List<MeshLog>

Suspend snapshot variant of getLogsFrom for one-shot reads (no Flow observer overhead). Used when a caller needs to read-then-process-then-delete in two steps — the selection requires Kotlin parsing so it stays outside the delete transaction, but the delete itself is atomic (see deleteLogsByUuidAtomic).

Link copied to clipboard
abstract suspend fun getLogsSnapshotPage(fromNum: Int, portNum: Int, beforeReceivedDate: Long?, beforeUuid: String?, pageSize: Int): List<MeshLog>

Returns one deterministic keyset page for bounded snapshot processing. beforeReceivedDate and beforeUuid identify the last row of the previous page; null values start from the newest row.

Link copied to clipboard
abstract suspend fun insert(log: MeshLog)
Link copied to clipboard
abstract suspend fun insertIgnore(logs: List<MeshLog>)