Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/radareorg/sdb
Simple and fast string based key-value database with support for arrays and json
https://github.com/radareorg/sdb
c data-structures database hacktoberfest hashtable key-value
Last synced: about 1 month ago
JSON representation
Simple and fast string based key-value database with support for arrays and json
- Host: GitHub
- URL: https://github.com/radareorg/sdb
- Owner: radareorg
- License: mit
- Created: 2012-09-03T23:15:15.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-08-31T14:33:07.000Z (4 months ago)
- Last Synced: 2024-10-29T21:06:10.344Z (about 2 months ago)
- Topics: c, data-structures, database, hacktoberfest, hashtable, key-value
- Language: C
- Homepage: https://www.radare.org/
- Size: 2.23 MB
- Stars: 218
- Watchers: 17
- Forks: 62
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- License: COPYING
- Authors: AUTHORS
Awesome Lists containing this project
README
SDB (string database)
=====================sdb is a simple string key/value database based on djb's cdb
disk storage and supports JSON and arrays introspection.mcsdbd is a memcache server with disk storage based on sdb.
It is distributed as a standalone binary and a library.There's also the sdbtypes: a vala library that implements
several data structures on top of an sdb or a memcache instance.[![GHA](https://github.com/radareorg/sdb/workflows/ci/badge.svg)](https://github.com/radareorg/sdb/actions?query=workflow%3Aci)
[![COV](https://scan.coverity.com/projects/1651/badge.svg)](https://scan.coverity.com/projects/1651)Author
------
pancakeContains
--------
* namespaces (multiple sdb paths)
* atomic database sync (never corrupted)
* bindings for vala, luvit, newlisp and nodejs
* command-line frontend for sdb databases
* memcache client and server with sdb backend
* arrays support (syntax sugar)
* json parser/getter (js0n.c)Rips
----
* disk storage based on cdb code
* linked lists from r2 apiCompilation
-----------
For native builds just type `make`. Everything will be compiled twice to get the .dylib and .a and sdb in PIC and nonPIC modes.To compile with Emscripten for Javascript:
make CC=emcc EXT_EXE=.js
To crosscompile with meson:
```
$ cat > cross-file.txt <=0.6):```
$ sdb - '[]list=1,2' '[0]list' '[0]list=foo' '[]list' '[+1]list=bar'
1
foo
2
```Let's play with json:
```
$ sdb d g='{"foo":1,"bar":{"cow":3}}'
$ sdb d g:bar.cow
3
$ sdb - user='{"id":123}' user:id=99 user:id
99
```Using the command-line without any disk database:
```
$ sdb - foo=bar foo a=3 +a -a
bar
4
3$ sdb -
foo=bar
foo
bar
a=3
+a
4
-a
3
```Remove the database
```
$ rm -f d
```