Home

Awesome

lmdb-zig

Lightweight, fully-featured, idiomatic cross-platform Zig bindings to Lightning Memory-Mapped Database (LMDB).

LMDB is a tiny, extraordinarily fast Btree-based embedded KV database with some excellent properties:

Refer to the 12 extensive unit tests provided here for usage instructions and guidelines.

Built and tested against Zig's master branch over all possible optimization modes.

Motivation

These bindings were built in mind for utilizing LMDB as the underlying backend of a database project.

As a result, extensive effort was put into exposing and testing as many different aspects of LMDB's functionality as possible with an emphasis on minimal overhead, such as fixed memory map addressing, in-place cursor updates, duplicate keys, on-the-fly backups, crash recovery, etc.

Setup

These bindings were built with first-class support for the zigmod package manager.

To incorporate these bindings into your project, include the following into your project's zig.mod:

- type: git
  path: https://github.com/lithdew/lmdb-zig

Afterwards, run:

zigmod fetch

Status

Presently, these bindings completely cover the entire API surface for LMDB except for the list of methods provided below that were deemed unnecessary. In the case you require any of these methods exported, please file an issue describing your use case.