summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-12-14 10:57:05 +0100
committerGravatar GitHub2024-12-14 10:57:05 +0100
commit97811f252fb4b019bd87e1cc814b7a9c167a416e (patch)
tree93a2df911af7bef958a62821cf757436153b30db /README.md
parentreadme: fix examples (diff)
parentUpdate README.md (diff)
downloadzig-sqlite-97811f252fb4b019bd87e1cc814b7a9c167a416e.tar.gz
zig-sqlite-97811f252fb4b019bd87e1cc814b7a9c167a416e.tar.xz
zig-sqlite-97811f252fb4b019bd87e1cc814b7a9c167a416e.zip
Merge pull request #172 from JudsenAtFlexgen/Documentation-update
fixup README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index c58434e..041b715 100644
--- a/README.md
+++ b/README.md
@@ -230,8 +230,10 @@ const row = try stmt.one(
230 .{}, 230 .{},
231 .{ .id = 20 }, 231 .{ .id = 20 },
232); 232);
233if (row) |row| { 233if (row) |r| {
234 std.log.debug("name: {}, age: {}", .{std.mem.spanZ(&row.name), row.age}); 234 const name_ptr: [*:0]const u8 = &r.name;
235 std.log.debug("name: {s}, age: {}", .{ std.mem.span(name_ptr), r.age });
236}
235} 237}
236``` 238```
237Notice 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. 239Notice 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.