DB.Snapshot

DB Snapshot

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

Constructors

this
this()
Undocumented in source.

Destructor

~this
~this()

Cleanup snapshot memory

Members

Properties

ptr
inout(leveldb_snapshot_t) ptr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
valid
bool valid [@property getter]

test if the snapshot has been created

Inherited Members

From ASnapshot

ptr
inout(leveldb_snapshot_t) ptr [@property getter]
Undocumented in source.

Throws

LeveldbException

Examples

auto opt = new Options;
opt.create_if_missing = true;
auto db = new DB(opt, "/my/db/")

auto snap = db.snapshot;
db.put(Slice("Future"), Slice("Stuff"));

auto ro = new ReadOptions;
ro.snapshot(snap);

string str;
assert(db.get(Slice("Future"), str));
assert(!db.get(Slice("Future"), str, ro));

Meta