sdb
simple key-value database baked by base64, json and arrays
- Provided by: radare2 (Version: 6.0.7+ds-1)
- Report a bug
simple key-value database baked by base64, json and arrays
sdb |
[-0dehjJv] -|db
[-|=|==] [.file|expr ..] |
SDB is a simple disk and memory string-based key-value database. It is based on CDB and uses
-d-D-C-G-e-h-j-J-h-vSome useful ways to run it:
$ sdb - ; in memory database
$ sdb test.db = < test.txt ; create database from text file
$ sdb test.db == a.txt b.txt ; create database from text files in a single command
$ sdb test.db ; dump contents of database
$ sdb test.db a=b a ; inline queries
Append those quoted commands to 'sdb -' to test these sdb_query expressions:
a=hello b=world a b # hello world
a=1 +a -a # 2 1 ; key inc/dec
a={"a":122} a:a=O a # {"a":0} ; json set
a={"foo":122} +a:foo # 123 ; json increment
[]a=1,2,3,4,5 [?]a # 5 ; count array
[]a=1,2,3,4,5 [0]a # 1 ; get element
[]a=1,2 [0]a=X a # X2 ; replace
[]a=1,2 [+0]a=0 a # 012 ; prepend
[]a=1,2 [-1]a=3 a # 123 ; append
pancake <pancake@nopcode.org>