const std = @import("std");
const lmdb = @cImport(@cInclude("lmdb.h"));
-pub usingnamespace lmdb;
-
pub const Cursor = struct {
const Self = @This();
ptr: ?*lmdb.MDB_txn = undefined,
env: Env = undefined,
- pub fn dbi(self: Txn, name: [:0]const u8) !Dbi {
+ pub fn dbi(self: Txn, name: ?[:0]const u8) !Dbi {
var result = Dbi{ .env = self.env, .txn = self };
// TODO: lmdb.MDB_INTEGERKEY?
switch (lmdb.mdb_dbi_open(self.ptr, @ptrCast(name), lmdb.MDB_CREATE, &result.ptr)) {
}
while (try cursor.get(&key, Value, .Next)) |val| {
- std.debug.print("{}: {?}\n", .{ key, val });
+ std.debug.print("{}: {}\n", .{ key, val });
}
}