MeshLogDao
Functions
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.
Deletes at most limit logs received before cutoffTimestamp and returns how many it removed. Callers repeat it until it removes fewer than limit, so a retention pass never holds the write lock for the whole backlog.
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.
The newest log of type, or null. Re-runs on every log write, so it reads one row through its index.
getLogsFrom for one port. Without the any-port branch SQLite walks the (from_num, port_num, received_date) index newest first and stops at maxItem, with no sort.
Returns up to pageSize logs after (afterReceivedDate, afterRowId), oldest first. Equal received dates stay in rowid order, which is the order a scan of the received_date index returns. Start from Long.MIN_VALUE for both and continue from the last row returned.
Retrieves MeshLogs on 'port_num' (PortNum) from any node except excludeFromNum.
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).
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.