kvdb 0.0.1

kvdb lightweight and simple key-value store


To use this package, run the following command in your project's root directory:

kvdb

Build Status

kvdb is lightweight and simple key-value dlang database (store) build on top of std.json

Usage



import std.stdio;
import dddb;

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();
}
Authors:
  • cvsae
Dependencies:
none
Versions:
0.0.1 2020-Oct-06
~main 2020-Oct-15
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 0 downloads total

Score:
0.4
Short URL:
kvdb.dub.pm