summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sqlite.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/sqlite.zig b/sqlite.zig
index 2ddb3f7..8662262 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -981,6 +981,10 @@ pub fn Iterator(comptime Type: type) type {
981 } 981 }
982 @compileError("enum column " ++ @typeName(FieldType) ++ " must have a BaseType of either string or int"); 982 @compileError("enum column " ++ @typeName(FieldType) ++ " must have a BaseType of either string or int");
983 }, 983 },
984 .Struct => {
985 const innervalue = try self.readField(FieldType.BaseType, options, i);
986 return try FieldType.readField(options.allocator, innervalue);
987 },
984 else => @compileError("cannot populate field of type " ++ @typeName(FieldType)), 988 else => @compileError("cannot populate field of type " ++ @typeName(FieldType)),
985 }, 989 },
986 }; 990 };
@@ -1186,6 +1190,9 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t
1186 } 1190 }
1187 @compileError("enum column " ++ @typeName(FieldType) ++ " must have a BaseType of either string or int to bind"); 1191 @compileError("enum column " ++ @typeName(FieldType) ++ " must have a BaseType of either string or int to bind");
1188 }, 1192 },
1193 .Struct => {
1194 return try self.bindField(FieldType.BaseType, options, field_name, i, try field.bindField(options.allocator));
1195 },
1189 else => @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType)), 1196 else => @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType)),
1190 }, 1197 },
1191 } 1198 }