summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sqlite.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/sqlite.zig b/sqlite.zig
index 4553a27..eb4e6d0 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -14,6 +14,23 @@ usingnamespace @import("error.zig");
14 14
15const logger = std.log.scoped(.sqlite); 15const logger = std.log.scoped(.sqlite);
16 16
17/// ZeroBlob is a blob with a fixed length containing only zeroes.
18///
19/// A ZeroBlob is intended to serve as a placeholder; content can later be written with incremental i/o.
20///
21/// Here is an example allowing you to write up to 1024 bytes to a blob with incremental i/o.
22///
23/// try db.exec("INSERT INTO user VALUES(1, ?)", .{}, .{sqlite.ZeroBlob{ .length = 1024 }});
24/// const row_id = db.getLastInsertRowID();
25///
26/// var blob = try db.openBlob(.main, "user", "data", row_id, .{ .write = true });
27///
28/// var blob_writer = blob.writer();
29/// try blob_writer.writeAll("foobar");
30///
31/// try blob.close();
32///
33/// Search for "zeroblob" on https://sqlite.org/c3ref/blob_open.html for more details.
17pub const ZeroBlob = struct { 34pub const ZeroBlob = struct {
18 length: usize, 35 length: usize,
19}; 36};