Skip to content

Commit a948faa

Browse files
committed
readme: fix examples
1 parent 3248725 commit a948faa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,8 @@ We can make sure the bind parameters have the right type if we rewrite the query
523523
var stmt = try db.prepare("SELECT id FROM user WHERE age > ? AND age < ? AND weight > ?{usize}");
524524
defer stmt.deinit();
525525
526+
const allocator = std.heap.page_allocator; // Use a suitable allocator
527+
526528
const rows = try stmt.all(usize, allocator, .{}, .{
527529
.age_1 = 10,
528530
.age_2 = 20,
@@ -567,7 +569,9 @@ To finish our example, passing the proper type allows it compile:
567569
var stmt = try db.prepare("SELECT id FROM user WHERE age > ? AND age < ? AND weight > ?{usize}");
568570
defer stmt.deinit();
569571
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, .{}, .{
571575
.age_1 = 10,
572576
.age_2 = 20,
573577
.weight = @as(usize, 200),

0 commit comments

Comments
 (0)