From 8be5530a3fcfc26c58e47035b4723308326dda1c Mon Sep 17 00:00:00 2001 From: thisLight Date: Thu, 7 Oct 2021 16:59:53 +0800 Subject: sqlite: move to new ParsedQuery and BindMarker --- sqlite.zig | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'sqlite.zig') diff --git a/sqlite.zig b/sqlite.zig index f734d54..4bbc650 100644 --- a/sqlite.zig +++ b/sqlite.zig @@ -1489,19 +1489,15 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t inline for (StructTypeInfo.fields) |struct_field, _i| { const bind_marker = query.bind_markers[_i]; - switch (bind_marker) { - .Typed => |typ| { - const FieldTypeInfo = @typeInfo(struct_field.field_type); - switch (FieldTypeInfo) { - .Struct, .Enum, .Union => comptime assertMarkerType( - if (@hasDecl(struct_field.field_type, "BaseType")) struct_field.field_type.BaseType else struct_field.field_type, - typ, - ), - else => comptime assertMarkerType(struct_field.field_type, typ), - } - }, - - .Untyped => {}, + if (bind_marker.typed) |typ| { + const FieldTypeInfo = @typeInfo(struct_field.field_type); + switch (FieldTypeInfo) { + .Struct, .Enum, .Union => comptime assertMarkerType( + if (@hasDecl(struct_field.field_type, "BaseType")) struct_field.field_type.BaseType else struct_field.field_type, + typ, + ), + else => comptime assertMarkerType(struct_field.field_type, typ), + } } } -- cgit v1.2.3