| ... | @@ -56,6 +56,10 @@ pub fn first(self: *Self, alloc: std.mem.Allocator, comptime T: type, comptime q | ... | @@ -56,6 +56,10 @@ pub fn first(self: *Self, alloc: std.mem.Allocator, comptime T: type, comptime q |
| 56 | return try stmt.oneAlloc(T, alloc, .{}, args); | 56 | return try stmt.oneAlloc(T, alloc, .{}, args); |
| 57 | } | 57 | } |
| 58 | | 58 | |
| | 59 | pub fn prepareDynamic(self: *Self, query: string) !sqlite.DynamicStatement { |
| | 60 | return self.db.prepareDynamic(query); |
| | 61 | } |
| | 62 | |
| 59 | pub fn doesTableExist(self: *Self, alloc: std.mem.Allocator, name: string) !bool { | 63 | pub fn doesTableExist(self: *Self, alloc: std.mem.Allocator, name: string) !bool { |
| 60 | for (try self.collect(alloc, string, "select name from sqlite_master where type=? AND name=?", .{ .type = "table", .name = name })) |item| { | 64 | for (try self.collect(alloc, string, "select name from sqlite_master where type=? AND name=?", .{ .type = "table", .name = name })) |item| { |
| 61 | if (std.mem.eql(u8, item, name)) { | 65 | if (std.mem.eql(u8, item, name)) { |