This is a gdbm interface for Lua 5.2.
gdbm is the GNU database manager,
a replacement of the UNIX dbm library, available at
www.gnu.org/software/gdbm/
If you're running Linux, you probably already have gdbm installed.

Returns a userdata representing the open database.
The filename is the name of the file
(the complete name; gdbm does not append any characters to this name).

The mode is a string, which must start with one of the following:r GDBM_READER - readerw GDBM_WRITER - writerc GDBM_WRCREAT -
if database does not exist create new onen GDBM_NEWDB -
create a new, empty, database
and the optional remaining characters can be any of the following:L GDBM_NOLOCKM GDBM_NOMMAPS GDBM_SYNC
For the meanings of these parameters see man gdbm.
Be aware that n will delete any database which
might already exist under that filename.

This routine should be used very infrequently.
If you have had a lot of deletions and would like to shrink the space
used by the gdbm file, this routine will reorganize the database.
Gdbm will not shorten the length of a database except by using
this reorganization.

The following code from test.lua,
by the module author Luiz Henrique de Figueiredo,
creates table proxies for gdbm databases, and two "for" generators:
"keys" and "entries", for convenient traversal of databases.

If this results in an error message such as:
Error: Could not find expected file libgdbm.a, or libgdbm.so,
or libgdbm.so.* for GDBM -- you may have to install GDBM in your
system and/or pass GDBM_DIR or GDBM_LIBDIR to the luarocks command.
Example: luarocks install lgdbm GDBM_DIR=/usr/local
then you need to find the appropriate directory with:
find /usr/lib -name 'libgdbm.*' -print
and then invoke:
luarocks install lgdbm GDBM_LIBDIR=/usr/lib/i386-linux-gnu/
(or wherever) accordingly.