diff options
| author | 2020-10-25 01:22:18 +0200 | |
|---|---|---|
| committer | 2020-10-25 01:22:18 +0200 | |
| commit | ec137ad44c1845e83ea62904e3e283ca152b53dc (patch) | |
| tree | 0bd264a9f1c1f336443f2f628ea143cb94511fa3 | |
| parent | fix test so that the compiler doesn't crash (diff) | |
| download | zig-sqlite-ec137ad44c1845e83ea62904e3e283ca152b53dc.tar.gz zig-sqlite-ec137ad44c1845e83ea62904e3e283ca152b53dc.tar.xz zig-sqlite-ec137ad44c1845e83ea62904e3e283ca152b53dc.zip | |
document the Bytes type
| -rw-r--r-- | sqlite.zig | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -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. | ||
| 120 | pub const Bytes = union(enum) { | 126 | pub const Bytes = union(enum) { |
| 121 | Blob: []const u8, | 127 | Blob: []const u8, |
| 122 | Text: []const u8, | 128 | Text: []const u8, |