From ec137ad44c1845e83ea62904e3e283ca152b53dc Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Sun, 25 Oct 2020 01:22:18 +0200 Subject: document the Bytes type --- sqlite.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sqlite.zig') 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 { } }; +/// Bytes is used to represent a byte slice with its SQLite datatype. +/// +/// Since Zig doesn't have strings we can't tell if a []u8 must be stored as a SQLite TEXT or BLOB, +/// this type can be used to communicate this when executing a statement. +/// +/// If a []u8 or []const u8 is passed as bind parameter it will be treated as TEXT. pub const Bytes = union(enum) { Blob: []const u8, Text: []const u8, -- cgit v1.2.3