diff options
| author | 2022-04-24 11:25:53 +0200 | |
|---|---|---|
| committer | 2022-04-24 11:25:53 +0200 | |
| commit | 87cc4804d3c5dbba2de44b19de439a3d3f3020ed (patch) | |
| tree | 26ef44c0d8da3fd064069712be38f34d5ff7a721 | |
| parent | add compile error when passing non-struct to Statement.bind (diff) | |
| download | zig-sqlite-87cc4804d3c5dbba2de44b19de439a3d3f3020ed.tar.gz zig-sqlite-87cc4804d3c5dbba2de44b19de439a3d3f3020ed.tar.xz zig-sqlite-87cc4804d3c5dbba2de44b19de439a3d3f3020ed.zip | |
clarify type name
Diffstat (limited to '')
| -rw-r--r-- | sqlite.zig | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1726,9 +1726,9 @@ pub const DynamicStatement = struct { | |||
| 1726 | // | 1726 | // |
| 1727 | // If however there are no name bind markers then the behaviour will revert to using the field index in the struct, and the fields order must be correct. | 1727 | // If however there are no name bind markers then the behaviour will revert to using the field index in the struct, and the fields order must be correct. |
| 1728 | fn bind(self: *Self, options: anytype, values: anytype) !void { | 1728 | fn bind(self: *Self, options: anytype, values: anytype) !void { |
| 1729 | const StructType = @TypeOf(values); | 1729 | const Type = @TypeOf(values); |
| 1730 | 1730 | ||
| 1731 | switch (@typeInfo(StructType)) { | 1731 | switch (@typeInfo(Type)) { |
| 1732 | .Struct => |StructTypeInfo| { | 1732 | .Struct => |StructTypeInfo| { |
| 1733 | inline for (StructTypeInfo.fields) |struct_field, struct_field_i| { | 1733 | inline for (StructTypeInfo.fields) |struct_field, struct_field_i| { |
| 1734 | const field_value = @field(values, struct_field.name); | 1734 | const field_value = @field(values, struct_field.name); |
| @@ -1759,7 +1759,7 @@ pub const DynamicStatement = struct { | |||
| 1759 | try self.bindField(ArrayTypeInfo.child, options, "unknown", @intCast(c_int, index), value_to_bind); | 1759 | try self.bindField(ArrayTypeInfo.child, options, "unknown", @intCast(c_int, index), value_to_bind); |
| 1760 | } | 1760 | } |
| 1761 | }, | 1761 | }, |
| 1762 | else => @compileError("Unsupported type for values: " ++ @typeName(StructType)), | 1762 | else => @compileError("Unsupported type for values: " ++ @typeName(Type)), |
| 1763 | } | 1763 | } |
| 1764 | } | 1764 | } |
| 1765 | 1765 | ||