diff options
| -rw-r--r-- | sqlite.zig | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -722,9 +722,6 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t | |||
| 722 | const column = i + 1; | 722 | const column = i + 1; |
| 723 | 723 | ||
| 724 | switch (FieldType) { | 724 | switch (FieldType) { |
| 725 | []const u8, []u8 => { | ||
| 726 | _ = c.sqlite3_bind_text(self.stmt, column, field.ptr, @intCast(c_int, field.len), null); | ||
| 727 | }, | ||
| 728 | Text => _ = c.sqlite3_bind_text(self.stmt, column, field.data.ptr, @intCast(c_int, field.data.len), null), | 725 | Text => _ = c.sqlite3_bind_text(self.stmt, column, field.data.ptr, @intCast(c_int, field.data.len), null), |
| 729 | Blob => _ = c.sqlite3_bind_blob(self.stmt, column, field.data.ptr, @intCast(c_int, field.data.len), null), | 726 | Blob => _ = c.sqlite3_bind_blob(self.stmt, column, field.data.ptr, @intCast(c_int, field.data.len), null), |
| 730 | else => switch (field_type_info) { | 727 | else => switch (field_type_info) { |
| @@ -733,6 +730,12 @@ pub fn Statement(comptime opts: StatementOptions, comptime query: ParsedQuery) t | |||
| 733 | .Bool => _ = c.sqlite3_bind_int64(self.stmt, column, @boolToInt(field)), | 730 | .Bool => _ = c.sqlite3_bind_int64(self.stmt, column, @boolToInt(field)), |
| 734 | .Pointer => |ptr| switch (ptr.size) { | 731 | .Pointer => |ptr| switch (ptr.size) { |
| 735 | .One => self.bindField(ptr.child, field_name, i, field.*), | 732 | .One => self.bindField(ptr.child, field_name, i, field.*), |
| 733 | .Slice => switch (ptr.child) { | ||
| 734 | u8 => { | ||
| 735 | _ = c.sqlite3_bind_text(self.stmt, column, field.ptr, @intCast(c_int, field.len), null); | ||
| 736 | }, | ||
| 737 | else => @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType)), | ||
| 738 | }, | ||
| 736 | else => @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType)), | 739 | else => @compileError("cannot bind field " ++ field_name ++ " of type " ++ @typeName(FieldType)), |
| 737 | }, | 740 | }, |
| 738 | .Array => |arr| { | 741 | .Array => |arr| { |