| ... | ... | @@ -27,7 +27,7 @@ pub fn close(self: *Self) void { |
| 27 | 27 | pub fn collect(self: *Self, alloc: *std.mem.Allocator, comptime T: type, comptime query: []const u8, args: anytype) ![]const T { |
| 28 | 28 | var stmt = try self.db.prepare(query); |
| 29 | 29 | defer stmt.deinit(); |
| 30 | | var iter = try stmt.iterator(T, args); |
| 30 | var iter = try stmt.iteratorAlloc(T, alloc, args); |
| 31 | 31 | var list = std.ArrayList(T).init(alloc); |
| 32 | 32 | while (try iter.nextAlloc(alloc, .{})) |row| { |
| 33 | 33 | try list.append(row); |
| ... | ... | @@ -35,10 +35,10 @@ pub fn collect(self: *Self, alloc: *std.mem.Allocator, comptime T: type, comptim |
| 35 | 35 | return list.toOwnedSlice(); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | | pub fn exec(self: *Self, comptime query: []const u8, args: anytype) !void { |
| 38 | pub fn exec(self: *Self, alloc: *std.mem.Allocator, comptime query: []const u8, args: anytype) !void { |
| 39 | 39 | var stmt = try self.db.prepare(query); |
| 40 | 40 | defer stmt.deinit(); |
| 41 | | try stmt.exec(args); |
| 41 | try stmt.execAlloc(.{ .allocator = alloc }, args); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | pub fn first(self: *Self, alloc: *std.mem.Allocator, comptime T: type, comptime query: []const u8, args: anytype) !?T { |