summaryrefslogtreecommitdiff
path: root/sqlite.zig
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2020-11-11 14:13:31 +0100
committerGravatar Vincent Rischmann2020-11-11 14:13:31 +0100
commit0d766361474ae47a2f21464913e348702705cf4e (patch)
treec9444ab595c27cecc2bf8ee718437fc2055c0858 /sqlite.zig
parentrefactor readBytes (diff)
downloadzig-sqlite-0d766361474ae47a2f21464913e348702705cf4e.tar.gz
zig-sqlite-0d766361474ae47a2f21464913e348702705cf4e.tar.xz
zig-sqlite-0d766361474ae47a2f21464913e348702705cf4e.zip
allow untyped bind markers
Diffstat (limited to '')
-rw-r--r--sqlite.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/sqlite.zig b/sqlite.zig
index 5dd6cdb..53e1a6a 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -202,8 +202,12 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t
202 } 202 }
203 203
204 inline for (StructTypeInfo.fields) |struct_field, _i| { 204 inline for (StructTypeInfo.fields) |struct_field, _i| {
205 if (struct_field.field_type != query.bind_markers[_i].Type) { 205 const bind_marker = query.bind_markers[_i];
206 @compileError("value type " ++ @typeName(struct_field.field_type) ++ " is not the bind marker type " ++ @typeName(query.bind_markers[_i].Type)); 206 switch (bind_marker) {
207 .Typed => |typ| if (struct_field.field_type != typ) {
208 @compileError("value type " ++ @typeName(struct_field.field_type) ++ " is not the bind marker type " ++ @typeName(typ));
209 },
210 .Untyped => {},
207 } 211 }
208 212
209 const i = @as(usize, _i); 213 const i = @as(usize, _i);