diff options
Diffstat (limited to 'sqlite.zig')
| -rw-r--r-- | sqlite.zig | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -160,9 +160,9 @@ pub const Db = struct { | |||
| 160 | 160 | ||
| 161 | fn getPragmaQuery(comptime buf: []u8, comptime name: []const u8, comptime arg: anytype) []const u8 { | 161 | fn getPragmaQuery(comptime buf: []u8, comptime name: []const u8, comptime arg: anytype) []const u8 { |
| 162 | return if (arg.len == 1) blk: { | 162 | return if (arg.len == 1) blk: { |
| 163 | break :blk try std.fmt.bufPrint(buf, "PRAGMA {} = {}", .{ name, arg[0] }); | 163 | break :blk try std.fmt.bufPrint(buf, "PRAGMA {s} = {s}", .{ name, arg[0] }); |
| 164 | } else blk: { | 164 | } else blk: { |
| 165 | break :blk try std.fmt.bufPrint(buf, "PRAGMA {}", .{name}); | 165 | break :blk try std.fmt.bufPrint(buf, "PRAGMA {s}", .{name}); |
| 166 | }; | 166 | }; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| @@ -1379,7 +1379,7 @@ test "sqlite: statement iterator" { | |||
| 1379 | var expected_rows = std.ArrayList(TestUser).init(allocator); | 1379 | var expected_rows = std.ArrayList(TestUser).init(allocator); |
| 1380 | var i: usize = 0; | 1380 | var i: usize = 0; |
| 1381 | while (i < 20) : (i += 1) { | 1381 | while (i < 20) : (i += 1) { |
| 1382 | const name = try std.fmt.allocPrint(allocator, "Vincent {}", .{i}); | 1382 | const name = try std.fmt.allocPrint(allocator, "Vincent {d}", .{i}); |
| 1383 | const user = TestUser{ .id = i, .name = name, .age = i + 200, .weight = @intToFloat(f32, i + 200) }; | 1383 | const user = TestUser{ .id = i, .name = name, .age = i + 200, .weight = @intToFloat(f32, i + 200) }; |
| 1384 | 1384 | ||
| 1385 | try expected_rows.append(user); | 1385 | try expected_rows.append(user); |