From 64ca232c10b4fcfe4977fd31bd3671b6c9eb9edb Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 23 Apr 2022 19:20:46 -0300 Subject: emit compileError on unsupported pointer sizes --- sqlite.zig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sqlite.zig b/sqlite.zig index b78099d..d6a5e79 100644 --- a/sqlite.zig +++ b/sqlite.zig @@ -1745,14 +1745,18 @@ pub const DynamicStatement = struct { // TODO support other pointer types std.debug.assert(PointerTypeInfo.size == .Slice); - for (values) |value_to_bind, index| { - std.log.info("awooga {} {}", .{ value_to_bind, index }); - try self.bindField(PointerTypeInfo.child, options, "", @intCast(c_int, index), value_to_bind); + switch (PointerTypeInfo.size) { + .Slice => { + for (values) |value_to_bind, index| { + try self.bindField(PointerTypeInfo.child, options, "unknown", @intCast(c_int, index), value_to_bind); + } + }, + else => @compileError("TODO support pointer size " ++ @tagName(PointerTypeInfo.size)), } }, .Array => |ArrayTypeInfo| { for (values) |value_to_bind, index| { - try self.bindField(ArrayTypeInfo.child, options, "", @intCast(c_int, index), value_to_bind); + try self.bindField(ArrayTypeInfo.child, options, "unknown", @intCast(c_int, index), value_to_bind); } }, else => @compileError("Unsupported type for values: " ++ @typeName(StructType)), -- cgit v1.2.3