Database ======== A tiny **btree** key-value store (file ``mydb``) behind a RAM dictionary. All keys and values are byte strings; ``read`` returns ``str`` and falls back to the default in ``database.params`` for keys never written. ``write`` only touches RAM and sets ``newdata``; ``store`` flushes to flash and is called at the end of every cycle, after a server ``*SET`` and before deep sleep. If the file cannot be opened at boot it is deleted and the board resets. The registry ``database.params`` doubles as the list of remotely writable parameters: :func:`~gpspro.firmware_core.handle_server_response` accepts a ``*SET`` only for keys whose access flag is ``"W"``. See :doc:`/gpspro/datatypes/system-ids` for every key. .. autoclass:: gpspro.firmware_core.database :members: :undoc-members: