authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-14 14:11:00 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-14 14:11:00 -07:00
logef9f5a749c06bbbe9b30ff582faa5b31150d83a6
treea349401cd88d53ae8661e9aa8b610d01ebac2b8b
parentc673458e1d44ba8981103bf336a6b2edd25198ac

sqlite3- add close method


1 files changed, 4 insertions(+), 0 deletions(-)

src/sqlite3.zig+4
...@@ -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}
2222
23pub fn close(self: *Self) void {
24 self.db.deinit();
25}
26
23pub fn collect(self: *Self, alloc: *std.mem.Allocator, comptime T: type, comptime query: []const u8) ![]const T {27pub 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();