feat(db): introduce transactional config installation (#3209)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-09-25 20:39:26 -05:00 committed by GitHub
parent 01290278e9
commit 6c0b2c55a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 63 deletions

View file

@ -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) })
}
}