Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heapwolf/ldb

A C++ REPL / CLI for LevelDB
https://github.com/heapwolf/ldb

cli database leveldb repl

Last synced: about 2 months ago
JSON representation

A C++ REPL / CLI for LevelDB

Awesome Lists containing this project

README

        

![img](/man/logo.png)

# SYNOPSIS
A c++ repl and cli tool for leveldb

# BUILD

## Mac OS X

```cli
$ brew install snappy cmake
$ git clone https://github.com/heapwolf/ldb.git
$ make install -C ldb
```

## Linux (Debian / others?)

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

# USAGE
Open an existing database with interactive mode (REPL) and create the
database if it does not exist with optional flag `--create`.
```bash
ldb ./testdb --create
```

Use as a commandline interface
```bash
ldb -h
```

## KEY AUTO-COMPLETE
`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.

![img](/man/colors.png)

## COMMANDS
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
```bash
>get foo
```

Put a value to a key
```bash
>put foo 100
```

List the keys in the curent range
```bash
>ls
```

Find string in keys or values using a regex
```bash
>in keys
>in values
```

![img](/man/find.png)

Set the start of the current range
```bash
>start
```

Set the end of the current range
```bash
>end
```

Set the limit for the current range
```bash
>limit
```

Get the size of the the current range (in bytes)
```bash
>size
```

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

```bash
>json
```

![img](/man/json.png)