summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sqlite.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/sqlite.zig b/sqlite.zig
index d8b5dc2..f5ec5e6 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -1398,7 +1398,7 @@ pub fn Iterator(comptime Type: type) type {
1398 inline for (@typeInfo(Type).Struct.fields) |field, _i| { 1398 inline for (@typeInfo(Type).Struct.fields) |field, _i| {
1399 const i = @as(usize, _i); 1399 const i = @as(usize, _i);
1400 1400
1401 const ret = try self.readField(field.field_type, options, i); 1401 const ret = try self.readField(field.type, options, i);
1402 1402
1403 @field(value, field.name) = ret; 1403 @field(value, field.name) = ret;
1404 } 1404 }
@@ -1673,7 +1673,7 @@ pub const DynamicStatement = struct {
1673 if (field_tag == this_tag) { 1673 if (field_tag == this_tag) {
1674 const field_value = @field(field, u_field.name); 1674 const field_value = @field(field, u_field.name);
1675 1675
1676 try self.bindField(u_field.field_type, options, u_field.name, i, field_value); 1676 try self.bindField(u_field.type, options, u_field.name, i, field_value);
1677 } 1677 }
1678 } 1678 }
1679 } else { 1679 } else {
@@ -1726,9 +1726,9 @@ pub const DynamicStatement = struct {
1726 1726
1727 const i = sqlite3BindParameterIndex(self.stmt, struct_field.name); 1727 const i = sqlite3BindParameterIndex(self.stmt, struct_field.name);
1728 if (i >= 0) { 1728 if (i >= 0) {
1729 try self.bindField(struct_field.field_type, options, struct_field.name, i, field_value); 1729 try self.bindField(struct_field.type, options, struct_field.name, i, field_value);
1730 } else { 1730 } else {
1731 try self.bindField(struct_field.field_type, options, struct_field.name, struct_field_i, field_value); 1731 try self.bindField(struct_field.type, options, struct_field.name, struct_field_i, field_value);
1732 } 1732 }
1733 } 1733 }
1734 }, 1734 },
@@ -2028,13 +2028,13 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: anytype) type
2028 inline for (StructTypeInfo.fields) |struct_field, _i| { 2028 inline for (StructTypeInfo.fields) |struct_field, _i| {
2029 const bind_marker = query.bind_markers[_i]; 2029 const bind_marker = query.bind_markers[_i];
2030 if (bind_marker.typed) |typ| { 2030 if (bind_marker.typed) |typ| {
2031 const FieldTypeInfo = @typeInfo(struct_field.field_type); 2031 const FieldTypeInfo = @typeInfo(struct_field.type);
2032 switch (FieldTypeInfo) { 2032 switch (FieldTypeInfo) {
2033 .Struct, .Enum, .Union => comptime assertMarkerType( 2033 .Struct, .Enum, .Union => comptime assertMarkerType(
2034 if (@hasDecl(struct_field.field_type, "BaseType")) struct_field.field_type.BaseType else struct_field.field_type, 2034 if (@hasDecl(struct_field.type, "BaseType")) struct_field.type.BaseType else struct_field.type,
2035 typ, 2035 typ,
2036 ), 2036 ),
2037 else => comptime assertMarkerType(struct_field.field_type, typ), 2037 else => comptime assertMarkerType(struct_field.type, typ),
2038 } 2038 }
2039 } 2039 }
2040 } 2040 }