diff options
| author | 2022-03-19 01:56:24 -0300 | |
|---|---|---|
| committer | 2022-05-14 21:25:51 +0200 | |
| commit | 19591635d2b28384345de2c68db03392e6a70bb9 (patch) | |
| tree | cd80c9540d4475ca6c2846df1ad9d54cf86cceb4 | |
| parent | add Db.runMulti (diff) | |
| download | zig-sqlite-19591635d2b28384345de2c68db03392e6a70bb9.tar.gz zig-sqlite-19591635d2b28384345de2c68db03392e6a70bb9.tar.xz zig-sqlite-19591635d2b28384345de2c68db03392e6a70bb9.zip | |
copy options over
| -rw-r--r-- | sqlite.zig | 9 |
1 files changed, 5 insertions, 4 deletions
| @@ -882,12 +882,13 @@ pub const Db = struct { | |||
| 882 | /// | 882 | /// |
| 883 | /// Exmaple: 'create table a(); create table b();' | 883 | /// Exmaple: 'create table a(); create table b();' |
| 884 | pub fn runMulti(self: *Self, comptime query: []const u8, options: QueryOptions) !void { | 884 | pub fn runMulti(self: *Self, comptime query: []const u8, options: QueryOptions) !void { |
| 885 | while (true) { | 885 | var new_options = options; |
| 886 | var sql_tail_ptr: ?[*:0]const u8 = null; | 886 | var sql_tail_ptr: ?[*:0]const u8 = null; |
| 887 | options.sql_tail_ptr = &sql_tail_ptr; | 887 | new_options.sql_tail_ptr = &sql_tail_ptr; |
| 888 | 888 | ||
| 889 | while (true) { | ||
| 889 | // continuously prepare and execute | 890 | // continuously prepare and execute |
| 890 | var stmt = try self.prepareWithDiags(query, options); | 891 | var stmt = try self.prepareWithDiags(query, new_options); |
| 891 | defer stmt.deinit(); | 892 | defer stmt.deinit(); |
| 892 | if (sql_tail_ptr == null) break; | 893 | if (sql_tail_ptr == null) break; |
| 893 | 894 | ||