mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(db): introduce transactional config installation (#3209)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
01290278e9
commit
6c0b2c55a0
4 changed files with 34 additions and 63 deletions
|
|
@ -221,4 +221,11 @@ interface NodeInfoDao {
|
|||
|
||||
@Query("UPDATE nodes SET notes = :notes WHERE num = :num")
|
||||
fun setNodeNotes(num: Int, notes: String)
|
||||
|
||||
@Transaction
|
||||
fun installConfig(mi: MyNodeEntity, nodes: List<NodeEntity>) {
|
||||
clearMyNodeInfo()
|
||||
setMyNodeInfo(mi)
|
||||
putAll(nodes.map { getVerifiedNodeForUpsert(it) })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue