dddb ~master
Dddb lightweight and simple key-value store
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
dddb
dddb is lightweight and simple key-value dlang database (store) build on top of std.json
Usage
dddb
import std.stdio;
import dddb;
void main()
{
// open a connection to database
auto db = new ddb("test.db");
// set value to specific key
db.set("hello", "world"); // true
// read the value of the specific key
writeln(db.get("hello")); // world
writeln(db.remove("hello")); // true
writeln(db.get("hello")); // Error: key not exists
// save to database
db.commit(); // True
}
Documantation
- SET key value → Set the value of a str key |→ Return Boolean
- GET key → Get the value of a key |→ Return String
- GETKEYS → Return all values from database |→ Return Array
- HAVEVALUE key VALUE → Determine if the value exists in the given key |→ Return Boolean
- HAVEKEY key → Determine if the key exists |→ Return Boolean
- REMOVE key → Remove the key from database |→ Return Boolean
- COUNTKEYS → Return the length of keys |→ Return Integer
- GETSIZE → Return the size of database (bytes) |→ Return Integer
- DROP → Delete everything from the database |→ Return Boolean
- ~master released 2 years ago
- cvsae/dddb
- MIT
- Copyright © 2018, cvsae
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.6 2018-Jul-01 0.0.5 2018-Jul-01 0.0.4 2018-Mar-25 0.0.3 2018-Mar-25 0.0.2 2018-Mar-23 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
51 downloads total
-
- Score:
- 1.4
- Short URL:
- dddb.dub.pm