summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sqlite.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/sqlite.zig b/sqlite.zig
index e1e3216..feb0295 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -456,6 +456,7 @@ pub fn Iterator(comptime Type: type) type {
456 456
457 const TypeInfo = @typeInfo(Type); 457 const TypeInfo = @typeInfo(Type);
458 458
459 db: *c.sqlite3,
459 stmt: *c.sqlite3_stmt, 460 stmt: *c.sqlite3_stmt,
460 461
461 // next scans the next row using the prepared statement. 462 // next scans the next row using the prepared statement.
@@ -843,6 +844,7 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t
843 return struct { 844 return struct {
844 const Self = @This(); 845 const Self = @This();
845 846
847 db: *c.sqlite3,
846 stmt: *c.sqlite3_stmt, 848 stmt: *c.sqlite3_stmt,
847 849
848 fn prepare(db: *Db, flags: c_uint) !Self { 850 fn prepare(db: *Db, flags: c_uint) !Self {
@@ -865,6 +867,7 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t
865 }; 867 };
866 868
867 return Self{ 869 return Self{
870 .db = db.db,
868 .stmt = stmt, 871 .stmt = stmt,
869 }; 872 };
870 } 873 }
@@ -1010,6 +1013,7 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t
1010 self.bind(values); 1013 self.bind(values);
1011 1014
1012 var res: Iterator(Type) = undefined; 1015 var res: Iterator(Type) = undefined;
1016 res.db = self.db;
1013 res.stmt = self.stmt; 1017 res.stmt = self.stmt;
1014 1018
1015 return res; 1019 return res;