.NET library for LMDB key-value store
Clone or download



Join the chat at https://gitter.im/CoreyKaylor/Lightning.NET Linux Build Status Windows Build status

.NET library for OpenLDAP's LMDB key-value store.

The API is easy to use and extremely fast.

using (var env = new LightningEnvironment("pathtofolder"))
	env.MaxDatabases = 2;

	using (var tx = env.BeginTransaction())
	using (var db = tx.OpenDatabase("custom", new DatabaseConfiguration { Flags = DatabaseOpenFlags.Create }))
		tx.Put(db, Encoding.UTF8.GetBytes("hello"), Encoding.UTF8.GetBytes("world"));
	using (var tx = env.BeginTransaction(TransactionBeginFlags.ReadOnly))
	using (var db = tx.OpenDatabase("custom"))
		var result = tx.Get(db, Encoding.UTF8.GetBytes("hello"));
		Assert.Equal(result, Encoding.UTF8.GetBytes("world"));

More examples can be found in the unit tests.

Official LMDB API docs

Library is available from NuGet: https://www.nuget.org/packages/LightningDB/

The library is published under MIT license.