DB.Snapshot

DB Snapshot

Snapshots can be applied to ReadOptions. Created from a DB object

Destructor

~this
~this()

Cleanup snapshot memory

Members

Properties

valid
bool valid [@property getter]

test if the snapshot has been created

Throws

LeveldbException

Examples

1 auto opt = new Options;
2 opt.create_if_missing = true;
3 auto db = new DB(opt, "/my/db/")
4 
5 auto snap = db.snapshot;
6 db.put(Slice("Future"), Slice("Stuff"));
7 
8 auto ro = new ReadOptions;
9 ro.snapshot(snap);
10 
11 string str;
12 assert(db.get(Slice("Future"), str));
13 assert(!db.get(Slice("Future"), str, ro));

Meta