authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-21 19:09:47 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-08-21 19:09:47 -07:00
log246ade7b2b8f138ebd477f86bf76a7a194144897
treecf90cca7df055b735cd9dffc45c6030b62edca19
parent2fbbe3c3d7925f3696face6ac349f14b1f44d5c0

add `args` param to sqlite3.collect


1 files changed, 2 insertions(+), 2 deletions(-)

src/sqlite3.zig+2-2
......@@ -24,10 +24,10 @@ pub fn close(self: *Self) void {
2424 self.db.deinit();
2525}
2626
27pub 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, args: anytype) ![]const T {
2828 var stmt = try self.db.prepare(query);
2929 defer stmt.deinit();
30 var iter = try stmt.iterator(T, .{});
30 var iter = try stmt.iterator(T, args);
3131 var list = std.ArrayList(T).init(alloc);
3232 while (try iter.nextAlloc(alloc, .{})) |row| {
3333 try list.append(row);