summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index 4454e9c..07a9845 100644
--- a/README.md
+++ b/README.md
@@ -228,7 +228,9 @@ const row = try stmt.one(
228 .{ .id = 20 }, 228 .{ .id = 20 },
229); 229);
230if (row) |r| { 230if (row) |r| {
231 std.log.debug("name: {}, age: {}", .{std.mem.span((&row.name).ptr), row.age}); 231 const name_ptr: [*:0]const u8 = &r.name;
232 std.log.debug("name: {s}, age: {}", .{ std.mem.span(name_ptr), r.age });
233}
232} 234}
233``` 235```
234Notice that to read text we need to use a 0-terminated array; if the `name` column is bigger than 127 bytes the call to `one` will fail. 236Notice that to read text we need to use a 0-terminated array; if the `name` column is bigger than 127 bytes the call to `one` will fail.