Nim wrapper for the Symas LMDB library
"…with only 32KB of object code, LMDB may seem tiny. But it’s the right 32KB." - from the LMDB home page.
More documentation: upstream docs - wikipedia page - exploring LMDB
-
Lightweight and ultra fast
-
nim doc documentation
-
Basic functional tests and benchmarks
-
Tested on Linux
# Development library:
nimble install lmdb
# Runtime dependency:
sudo apt-get install liblmdb0
import lmdb
# create dbenv, transaction and a dbi
let dbenv = newLMDBEnv("./testdb")
let txn = dbenv.newTxn()
let dbi = txn.dbiOpen(nil, 0)
txn.put(dbi, "foo", "value")
let g = txn.get(dbi, "foo")
txn.del(dbi, "foo", "value")
# commit or abort transaction
txn.commit() # or txn.abort()
# close dbi and env
dbenv.close(dbi)
dbenv.envClose()
Also see tests/functional.nim for more examples.