SqlDelightStorageProvider
StorageProvider backed by SQLDelight + SQLite, keyed by radio NodeNum so the same physical device shares one database across transports (BLE ↔ TCP ↔ serial).
File layout
<baseDir>/
.meshtastic-index ← identity ↔ nodeNum ↔ opaque-dbId bindings
<dbId>.db ← one SQLite DB per radio (opaque filename)Activation flow
activate(identity)reads the index.If
identity → dbIdmapping exists, open<dbId>.dbdirectly.Otherwise return a deferred wrapper that buffers reads/writes in-memory until the radio's NodeNum is learned via DeviceStorage.recordOwnNode.
On first
recordOwnNode(nodeNum, …)for a deferred wrapper:If
nodeNum → dbIdmapping already exists (same radio already reached via another transport), open that DB; buffered scratch state is replayed into it.Otherwise allocate a fresh opaque
dbId, create<dbId>.db, replay scratch.Persist both
identity → dbIdandnodeNum → dbIdbindings atomically.If a later
recordOwnNodereports a differentnodeNum(factory reset / radio swap), the inner storage's own factory-reset logic clears the DB; the provider updates thenodeNum → dbIdbinding so the old NodeNum no longer resolves to this DB.
Pass baseDir = "" for in-memory-only mode (every activation returns a fresh in-memory DB).
Parameters
path to the directory where database files and the index live