summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-12-14 01:23:39 +0100
committerGravatar Vincent Rischmann2024-12-14 01:23:39 +0100
commit13693a472c737d871ca31928d4238ace6f08b7f8 (patch)
treec34d655400c3fa9cf79b4301a8c3c041e7af4cb8
parentfix table used in example (diff)
downloadzig-sqlite-13693a472c737d871ca31928d4238ace6f08b7f8.tar.gz
zig-sqlite-13693a472c737d871ca31928d4238ace6f08b7f8.tar.xz
zig-sqlite-13693a472c737d871ca31928d4238ace6f08b7f8.zip
readme: define the allocator
Diffstat (limited to '')
-rw-r--r--README.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/README.md b/README.md
index d73aa3d..5c2349c 100644
--- a/README.md
+++ b/README.md
@@ -285,6 +285,8 @@ const query =
285var stmt = try db.prepare(query); 285var stmt = try db.prepare(query);
286defer stmt.deinit(); 286defer stmt.deinit();
287 287
288const allocator = std.heap.page_allocator; // Use a proper allocator
289
288const names = try stmt.all([]const u8, allocator, .{}, .{ 290const names = try stmt.all([]const u8, allocator, .{}, .{
289 .age1 = 20, 291 .age1 = 20,
290 .age2 = 40, 292 .age2 = 40,
@@ -304,6 +306,8 @@ const query =
304var stmt = try db.prepare(query); 306var stmt = try db.prepare(query);
305defer stmt.deinit(); 307defer stmt.deinit();
306 308
309const allocator = std.heap.page_allocator; // Use a proper allocator
310
307const row = try stmt.oneAlloc([]const u8, allocator, .{}, .{ 311const row = try stmt.oneAlloc([]const u8, allocator, .{}, .{
308 .id = 200, 312 .id = 200,
309}); 313});