summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sqlite.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/sqlite.zig b/sqlite.zig
index f434a61..d45bda3 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -1653,7 +1653,13 @@ pub const DynamicStatement = struct {
1653 } 1653 }
1654 }, 1654 },
1655 .Struct => { 1655 .Struct => {
1656 try self.bindField(FieldType.BaseType, options, field_name, i, try field.bindField(options.allocator)); 1656 if (!comptime std.meta.trait.hasFn("bindField")(FieldType)) {
1657 @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType) ++ ", consider implementing the bindField() method");
1658 }
1659
1660 const field_value = try field.bindField(options.allocator);
1661
1662 try self.bindField(FieldType.BaseType, options, field_name, i, field_value);
1657 }, 1663 },
1658 else => @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType)), 1664 else => @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType)),
1659 }, 1665 },