A C++ REPL / CLI for LevelDB
C++ Makefile
Switch branches/tags
Nothing to show
Clone or download
hxoht Merge pull request #54 from andybalaam/linux-build-doc-fixes
Fix some bugs in the Linux build instructions
Latest commit c36d726 Apr 30, 2018




A c++ repl and cli tool for leveldb


Mac OS X

$ brew install snappy cmake
$ git clone https://github.com/0x00a/ldb.git
$ make install -C ldb

Linux (Debian / others?)

$ sudo apt-get install libsnappy-dev cmake
$ git clone https://github.com/0x00a/ldb.git
$ cd ldb
$ make && sudo make install


Open an existing database with interactive mode (REPL) and create the database if it does not exist with optional flag --create.

ldb ./testdb --create

Use as a commandline interface

ldb -h


ldb will get the first n (as defined in LIMIT) records and make them available for autocomplete. If the limit is redefined, the cache will be refreshed to reflect the new range.

When possible, hitting tab will allow you to cycle though keys that match your partial input. Also, if there is a partial match it will be highlighted in the results.



You can get, put or del a single key at any time. Many of the following commands help you to create ranges so that you can casually explore smaller sets of data. Type ? to print more help.

Get a key's value

>get foo

Put a value to a key

>put foo 100

List the keys in the curent range


Find string in keys or values using a regex

>in keys <regex>
>in values <regex>


Set the start of the current range

>start <string>

Set the end of the current range

>end <string>

Set the limit for the current range

>limit <number>

Get the size of the the current range (in bytes)


Try to format the output of values as JSON. Use <number> is the indent) and 0 to turn off JSON formatting.

>json <number>