File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -523,6 +523,8 @@ We can make sure the bind parameters have the right type if we rewrite the query
523
523
var stmt = try db.prepare("SELECT id FROM user WHERE age > ? AND age < ? AND weight > ?{usize}");
524
524
defer stmt.deinit();
525
525
526
+ const allocator = std.heap.page_allocator; // Use a suitable allocator
527
+
526
528
const rows = try stmt.all(usize, allocator, .{}, .{
527
529
.age_1 = 10,
528
530
.age_2 = 20,
@@ -567,7 +569,9 @@ To finish our example, passing the proper type allows it compile:
567
569
var stmt = try db.prepare("SELECT id FROM user WHERE age > ? AND age < ? AND weight > ?{usize}");
568
570
defer stmt.deinit();
569
571
570
- const rows = try stmt.all(usize, .{}, .{
572
+ const allocator = std.heap.page_allocator; // Use a suitable allocator
573
+
574
+ const rows = try stmt.all(usize, allocator, .{}, .{
571
575
.age_1 = 10,
572
576
.age_2 = 20,
573
577
.weight = @as(usize, 200),
You can’t perform that action at this time.
0 commit comments