diff options
| author | 2022-04-21 22:06:41 +0200 | |
|---|---|---|
| committer | 2022-04-21 22:13:10 +0200 | |
| commit | 652fe2f3d43891b82fa370fa5720aed6e3205d89 (patch) | |
| tree | ebedf2c385c6680ef4309a240ee87b7b6cbbfa06 /sqlite.zig | |
| parent | Merge branch 'fix-function-aarch64' (diff) | |
| download | zig-sqlite-652fe2f3d43891b82fa370fa5720aed6e3205d89.tar.gz zig-sqlite-652fe2f3d43891b82fa370fa5720aed6e3205d89.tar.xz zig-sqlite-652fe2f3d43891b82fa370fa5720aed6e3205d89.zip | |
check explicitly that bindField is implemented
Diffstat (limited to '')
| -rw-r--r-- | sqlite.zig | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -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 | }, |