Skip to content

Commit 97811f2

Browse files
authored
Merge pull request #172 from JudsenAtFlexgen/Documentation-update
fixup README.md
2 parents d1e3865 + 8fe3f3c commit 97811f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ const row = try stmt.one(
230230
.{},
231231
.{ .id = 20 },
232232
);
233-
if (row) |row| {
234-
std.log.debug("name: {}, age: {}", .{std.mem.spanZ(&row.name), row.age});
233+
if (row) |r| {
234+
const name_ptr: [*:0]const u8 = &r.name;
235+
std.log.debug("name: {s}, age: {}", .{ std.mem.span(name_ptr), r.age });
236+
}
235237
}
236238
```
237239
Notice 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.

0 commit comments

Comments
 (0)