| ... | @@ -20,6 +20,10 @@ pub fn connect(path: [:0]const u8) !Self { | ... | @@ -20,6 +20,10 @@ pub fn connect(path: [:0]const u8) !Self { |
| 20 | }; | 20 | }; |
| 21 | } | 21 | } |
| 22 | | 22 | |
| | 23 | pub fn close(self: *Self) void { |
| | 24 | self.db.deinit(); |
| | 25 | } |
| | 26 | |
| 23 | pub fn collect(self: *Self, alloc: *std.mem.Allocator, comptime T: type, comptime query: []const u8) ![]const T { | 27 | pub fn collect(self: *Self, alloc: *std.mem.Allocator, comptime T: type, comptime query: []const u8) ![]const T { |
| 24 | var stmt = try self.db.prepare(query); | 28 | var stmt = try self.db.prepare(query); |
| 25 | defer stmt.deinit(); | 29 | defer stmt.deinit(); |