kvdb ~cvsae-patch-in-memmory-store
kvdb 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:
kvdb
kvdb is lightweight and simple key-value dlang database (store) build on top of std.json
Usage
import std.stdio;
import kvdb;
void main()
{
kvdb db = new kvdb("test.db");
// assign to hello key the value world
db.set("hello", "world");
// read value for key hello
string value = db.get("hello")
// print value of hello key
writeln(value);
// world
// update hello key value from world to goodbye
db.update("hello", "goodbye");
// read value for key hello
string value_updated = db.get("hello")
// print value of hello key
writeln(value_updated);
// goodbye
// lookup if key exists
bool havekey = db.havekey("hello");
if (havekey)
writeln("key exists")
else{
writeln("key not exists")
}
writeln(db.getsize());
// db.getsize() return the database size in bytes
// db.drop() delete database
// NOTE: all db data will be lost
db.drop();
}
- Registered by cvsae
- ~cvsae-patch-in-memmory-store released 4 years ago
- cvsae/kvdb
- MIT
- Copyright © 2020, cvsae
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.3 2020-Nov-12 0.0.2 2020-Nov-11 0.0.1 2020-Oct-06 ~main 2020-Nov-12 ~cvsae-patch-manual-commit 2020-Nov-12 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
16 downloads total
-
- Score:
- 0.4
- Short URL:
- kvdb.dub.pm