summaryrefslogtreecommitdiff
path: root/sqlite.zig
diff options
context:
space:
mode:
Diffstat (limited to 'sqlite.zig')
-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);