NDBM support for Go. State of the art structured storage for 1986.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE.txt
README.md
gdbm_compat.h
gdbm_compat_linux.c
ndbm.go
ndbm_nonposix.go
ndbm_posix.go
ndbm_test.go

README.md

ndbm

Github license Travis CI build status GoDoc

State of the art structured storage for 1986.

ndbm is a Go wrapper around the POSIX NDBM database interface. NDBM is built into Mac OS X and FreeBSD, and is available as a compatibility mode of the GDBM library on Linux.

API documentation is available on GoDoc.

Why?

I wrote the first version of this library on a Mac on a cruise ship, where I needed a persistent key-value store, but had no Internet connection, just OS X system libraries, man pages, and Go documentation.

Linux notes

Most Linux distros don't package an NDBM implementation. Debian/Ubuntu users should install libgdbm3 and libgdbm-dev before building.

To make this package go gettable, I've targeted the quirky GDBM 1.8, which is the version available on Ubuntu 12-15 and Debian 7-8, instead of attempting build-time library detection, which would allow using the current and more NDBM-compatible GDBM 1.11.

If you are using a recent GDBM that provides ndbm.h, you will probably need to delete gdbm_compat.h and gdbm_compat_linux.c and the #ifdef __linux checks.

Background

POSIX standard for NDBM:

Mac OS X NDBM:

FreeBSD NDBM:

GDBM: