diff options
| author | 2020-11-11 14:13:31 +0100 | |
|---|---|---|
| committer | 2020-11-11 14:13:31 +0100 | |
| commit | 0d766361474ae47a2f21464913e348702705cf4e (patch) | |
| tree | c9444ab595c27cecc2bf8ee718437fc2055c0858 /sqlite.zig | |
| parent | refactor readBytes (diff) | |
| download | zig-sqlite-0d766361474ae47a2f21464913e348702705cf4e.tar.gz zig-sqlite-0d766361474ae47a2f21464913e348702705cf4e.tar.xz zig-sqlite-0d766361474ae47a2f21464913e348702705cf4e.zip | |
allow untyped bind markers
Diffstat (limited to '')
| -rw-r--r-- | sqlite.zig | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -202,8 +202,12 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t | |||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | inline for (StructTypeInfo.fields) |struct_field, _i| { | 204 | inline for (StructTypeInfo.fields) |struct_field, _i| { |
| 205 | if (struct_field.field_type != query.bind_markers[_i].Type) { | 205 | const bind_marker = query.bind_markers[_i]; |
| 206 | @compileError("value type " ++ @typeName(struct_field.field_type) ++ " is not the bind marker type " ++ @typeName(query.bind_markers[_i].Type)); | 206 | switch (bind_marker) { |
| 207 | .Typed => |typ| if (struct_field.field_type != typ) { | ||
| 208 | @compileError("value type " ++ @typeName(struct_field.field_type) ++ " is not the bind marker type " ++ @typeName(typ)); | ||
| 209 | }, | ||
| 210 | .Untyped => {}, | ||
| 207 | } | 211 | } |
| 208 | 212 | ||
| 209 | const i = @as(usize, _i); | 213 | const i = @as(usize, _i); |