diff options
| author | 2022-05-12 23:24:42 -0300 | |
|---|---|---|
| committer | 2022-05-14 21:25:51 +0200 | |
| commit | 4bb2a5c3190e748cbad7477c43e1d1df5cbe31b6 (patch) | |
| tree | 6ffce4bbfb439a2df881898555dcec75ca1a0c4c | |
| parent | add newlines and comments to runMulti test case (diff) | |
| download | zig-sqlite-4bb2a5c3190e748cbad7477c43e1d1df5cbe31b6.tar.gz zig-sqlite-4bb2a5c3190e748cbad7477c43e1d1df5cbe31b6.tar.xz zig-sqlite-4bb2a5c3190e748cbad7477c43e1d1df5cbe31b6.zip | |
rename to execMulti
| -rw-r--r-- | sqlite.zig | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -881,7 +881,7 @@ pub const Db = struct { | |||
| 881 | /// bindings to values, but have multiple commands inside. | 881 | /// bindings to values, but have multiple commands inside. |
| 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 execMulti(self: *Self, comptime query: []const u8, options: QueryOptions) !void { |
| 885 | var new_options = options; | 885 | var new_options = options; |
| 886 | var sql_tail_ptr: ?[*:0]const u8 = null; | 886 | var sql_tail_ptr: ?[*:0]const u8 = null; |
| 887 | new_options.sql_tail_ptr = &sql_tail_ptr; | 887 | new_options.sql_tail_ptr = &sql_tail_ptr; |
| @@ -2325,7 +2325,7 @@ test "sqlite: db init" { | |||
| 2325 | test "sqlite: run multi" { | 2325 | test "sqlite: run multi" { |
| 2326 | var db = try getTestDb(); | 2326 | var db = try getTestDb(); |
| 2327 | defer db.deinit(); | 2327 | defer db.deinit(); |
| 2328 | try db.runMulti("create table a(b int);\n\n--test comment\ncreate table b(c int);", .{}); | 2328 | try db.execMulti("create table a(b int);\n\n--test comment\ncreate table b(c int);", .{}); |
| 2329 | const val = try db.one(i32, "select max(c) from b", .{}, .{}); | 2329 | const val = try db.one(i32, "select max(c) from b", .{}, .{}); |
| 2330 | try testing.expectEqual(@as(?i32, 0), val); | 2330 | try testing.expectEqual(@as(?i32, 0), val); |
| 2331 | } | 2331 | } |