]> gitweb.ps.run Git - ziglmdb/blobdiff - src/lmdb.zig
changes
[ziglmdb] / src / lmdb.zig
index 88c8e22aecb985611418fb091b44f770fb5a368d..b7d97eaf8cab0e7ff7c7103d42c3603c33fc32de 100644 (file)
@@ -1,8 +1,6 @@
 const std = @import("std");
 const lmdb = @cImport(@cInclude("lmdb.h"));
 
-pub usingnamespace lmdb;
-
 pub const Cursor = struct {
     const Self = @This();
 
@@ -207,7 +205,7 @@ pub const Txn = struct {
     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)) {
@@ -339,7 +337,7 @@ test "cursor" {
     }
 
     while (try cursor.get(&key, Value, .Next)) |val| {
-        std.debug.print("{}: {?}\n", .{ key, val });
+        std.debug.print("{}: {}\n", .{ key, val });
     }
 }