Key-value
Binary-safe values for configuration and application state, bounded by configured key and value limits. Optional TTL and compile-time overflow policy shape behavior at capacity.
Three small data models, one predictable storage core.
A compact C99 database for firmware and edge runtimes: key-value state, timestamped telemetry and small fixed-schema tables share one API and an optional storage abstraction. Memory bounds and persistence behavior are explicit design inputs.
Available through PlatformIO Registry and Arduino Library Manager. Integration remains target and adapter specific.
LOX DB puts several bounded data models behind one C interface. Each remains deliberately narrower than a server database: callers size storage and choose policies for their workload.
Binary-safe values for configuration and application state, bounded by configured key and value limits. Optional TTL and compile-time overflow policy shape behavior at capacity.
Typed streams for F32, I32, U32 and raw samples, with timestamp range queries and retention/overflow policies. Packed samples pair timestamps with values. The TS arena is divided evenly among configured stream slots, so mixed types do not use every byte equally efficiently.
Small fixed-schema tables with explicit schema declarations, row helpers and one indexed column per table. This is a compact record model, not general SQL planning or arbitrary joins.
lox_init() validates configuration and storage, creates internal arenas and loads durable state when storage is supplied. Normal engine operations do not churn the core allocator after successful initialization; ports and user callbacks have their own allocation behavior.The database targets MCU and edge systems where memory must be budgeted before normal work begins. Configuration chooses the main RAM budget and engine capacities. The core makes one main heap allocation during initialization and releases it at lox_deinit().
This statement is scoped to the core. Platform adapters, storage callbacks and application code may allocate independently. A bounded database arena does not bound total firmware memory unless those components are budgeted too.
Handles may be several KiB; the manual recommends keeping potentially large lox_t objects off small task stacks. Review profile and footprint gates for the exact build configuration.
Persistence is optional. A storage adapter supplies read, write, erase and sync callbacks through lox_storage_t. The abstraction lets the core work with RAM-backed and platform-backed media while keeping erase geometry and write constraints visible at initialization.
Repository ports cover RAM and POSIX use, an ESP32 path, and optional backend adapters. A port is an integration surface: durability and electrical properties depend on its implementation and physical medium.
When WAL support is enabled with persistent storage, reopening validates durable state and applies documented recovery rules. The manual describes replay, handling recoverable WAL tails and compaction. Some anomalies can return success with recovery performed; success does not mean no anomaly occurred.
The published ESP32-S3 benchmark uses an in-RAM flash-like storage backend. It measures target CPU work and logical backend operations, not physical NOR latency, brownout recovery, erase endurance or board-level power-loss behavior.
The core is portable C99 with no required third-party runtime library. CMake exports an installable package as loxdb::loxdb; detached C and C++ consumer checks exercise installed-package use. A C++ convenience wrapper is separate from the C API.
RAM and POSIX ports, an ESP32 path and optional backend adapters cover different environments. Arduino and PlatformIO manifests publish the library through their registries. Hardware- or filesystem-specific behavior still depends on the chosen adapter and board.
static lox_t db; /* keep the handle off a small stack */
lox_storage_t storage;
lox_cfg_t cfg = {0};
if (lox_port_ram_init(&storage, 64u * 1024u) != LOX_OK) return 1;
cfg.storage = &storage;
cfg.ram_kb = 32u;
if (lox_init(&db, &cfg) != LOX_OK) return 1;
uint8_t value = 7u;
if (lox_kv_put(&db, "mode", &value, sizeof value) != LOX_OK) return 1;The current evidence matrix records MSVC Debug at 110/110 CTest entries, MinGW Debug at 110/110 and Release at 111/111, and Clang MinGW-target Debug/Release at those respective counts.
The matrix records cppcheck warning/performance/portability and clang-tidy analyzer, bugprone, performance and portability checks passing locally.
The repository publishes timings and throughput from an ESP32-S3 N16R8 run backed by an in-RAM flash-like HAL. These are target measurements, not physical-flash results.
The evidence matrix reports no physical NOR sync/write/erase, brownout or endurance evidence. Linux/macOS and sanitizer CI lanes are configuration, not host-execution evidence.
The repository's documented desktop path uses a CMake preset and CTest. Preset availability depends on the host platform.
cmake --preset ci-debug-linux
cmake --build --preset ci-debug-linux
ctest --preset ci-debug-linuxFor installed consumers, the package exports loxdb::loxdb and generated CMake package/version files. Source archives and install-prefix SDK bundles have different contents; consult the current README and release assets when packaging a deployment.
LOX DB Pro is a separate product in the LOX family. Its product page defines its own scope; this page describes the open-source LOX DB repository.