GoLMDB

GoLMDB
Login

GoLMDB

This is a high-level binding to LMDB.

go get wellquite.org/golmdb@latest

This binding uses cgo and so to build, you'll need a working cgo environment: a supported C compiler suite, alongside the LMDB library and headers. LMDB is extremely widely used and is available on "all" platforms, so it shouldn't be difficult to get it on your platform. This binding has been predominately developed with version 0.9.29, which is the current version at the time of writing.

There are several Go bindings to LMDB available. All of them (that I can find) are fairly low-level and tend to mirror the C API into Go. This provides a lot of flexibility, but it leaves a lot of work to do too.

This binding is high-level. It does not attempt to support all the features of LMDB, nor expose the full low-level LMDB API. It provides:

Many of the more advanced flags from LMDB are still available, for example flags to turn off syncing. These flags can make updates/writes appear to be much faster. But they are also foot-guns: they can be used safely in certain circumstances, but they're highly likely to blow your foot off and destroy your data if you're not careful. This binding will not save you from yourself! Refer back to the original LMDB docs if you're in any doubt.

There are a few more words about this over on my blog