summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2020-10-25 01:22:18 +0200
committerGravatar Vincent Rischmann2020-10-25 01:22:18 +0200
commitec137ad44c1845e83ea62904e3e283ca152b53dc (patch)
tree0bd264a9f1c1f336443f2f628ea143cb94511fa3
parentfix test so that the compiler doesn't crash (diff)
downloadzig-sqlite-ec137ad44c1845e83ea62904e3e283ca152b53dc.tar.gz
zig-sqlite-ec137ad44c1845e83ea62904e3e283ca152b53dc.tar.xz
zig-sqlite-ec137ad44c1845e83ea62904e3e283ca152b53dc.zip
document the Bytes type
-rw-r--r--sqlite.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/sqlite.zig b/sqlite.zig
index e29977a..116807a 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -117,6 +117,12 @@ pub const Db = struct {
117 } 117 }
118}; 118};
119 119
120/// Bytes is used to represent a byte slice with its SQLite datatype.
121///
122/// Since Zig doesn't have strings we can't tell if a []u8 must be stored as a SQLite TEXT or BLOB,
123/// this type can be used to communicate this when executing a statement.
124///
125/// If a []u8 or []const u8 is passed as bind parameter it will be treated as TEXT.
120pub const Bytes = union(enum) { 126pub const Bytes = union(enum) {
121 Blob: []const u8, 127 Blob: []const u8,
122 Text: []const u8, 128 Text: []const u8,