diff options
| author | 2021-08-24 12:16:53 -0700 | |
|---|---|---|
| committer | 2021-08-24 12:16:53 -0700 | |
| commit | bfadc7bcc37a3e1d5b30f2b9f3a35e62b3b1e63e (patch) | |
| tree | 386f2ff5940719309f5818d646517c096843b130 /sqlite.zig | |
| parent | tests- add enum field cases (diff) | |
| download | zig-sqlite-bfadc7bcc37a3e1d5b30f2b9f3a35e62b3b1e63e.tar.gz zig-sqlite-bfadc7bcc37a3e1d5b30f2b9f3a35e62b3b1e63e.tar.xz zig-sqlite-bfadc7bcc37a3e1d5b30f2b9f3a35e62b3b1e63e.zip | |
fix bind index
Diffstat (limited to 'sqlite.zig')
| -rw-r--r-- | sqlite.zig | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1102,10 +1102,10 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t | |||
| 1102 | .Null => _ = c.sqlite3_bind_null(self.stmt, column), | 1102 | .Null => _ = c.sqlite3_bind_null(self.stmt, column), |
| 1103 | .Enum => { | 1103 | .Enum => { |
| 1104 | if (comptime std.meta.trait.isZigString(FieldType.BaseType)) { | 1104 | if (comptime std.meta.trait.isZigString(FieldType.BaseType)) { |
| 1105 | return self.bindField(FieldType.BaseType, field_name, column, @tagName(field)); | 1105 | return self.bindField(FieldType.BaseType, field_name, i, @tagName(field)); |
| 1106 | } | 1106 | } |
| 1107 | if (@typeInfo(FieldType.BaseType) == .Int) { | 1107 | if (@typeInfo(FieldType.BaseType) == .Int) { |
| 1108 | return self.bindField(FieldType.BaseType, field_name, column, @enumToInt(field)); | 1108 | return self.bindField(FieldType.BaseType, field_name, i, @enumToInt(field)); |
| 1109 | } | 1109 | } |
| 1110 | @compileError("enum column " ++ @typeName(FieldType) ++ " must have a BaseType of either string or int to bind"); | 1110 | @compileError("enum column " ++ @typeName(FieldType) ++ " must have a BaseType of either string or int to bind"); |
| 1111 | }, | 1111 | }, |