diff options
| author | 2022-04-11 23:28:34 -0300 | |
|---|---|---|
| committer | 2022-04-24 11:22:42 +0200 | |
| commit | 9898c4ee14541a811ae6a805bf075a879281ff96 (patch) | |
| tree | 865767de9217f64d6297bf0223a48bdcbd786a12 /sqlite.zig | |
| parent | allow slices to be passed as bind parameters (diff) | |
| download | zig-sqlite-9898c4ee14541a811ae6a805bf075a879281ff96.tar.gz zig-sqlite-9898c4ee14541a811ae6a805bf075a879281ff96.tar.xz zig-sqlite-9898c4ee14541a811ae6a805bf075a879281ff96.zip | |
add support for arrays as runtime bind values
Diffstat (limited to 'sqlite.zig')
| -rw-r--r-- | sqlite.zig | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -1750,6 +1750,11 @@ pub const DynamicStatement = struct { | |||
| 1750 | try self.bindField(PointerTypeInfo.child, options, "", @intCast(c_int, index), value_to_bind); | 1750 | try self.bindField(PointerTypeInfo.child, options, "", @intCast(c_int, index), value_to_bind); |
| 1751 | } | 1751 | } |
| 1752 | }, | 1752 | }, |
| 1753 | .Array => |ArrayTypeInfo| { | ||
| 1754 | for (values) |value_to_bind, index| { | ||
| 1755 | try self.bindField(ArrayTypeInfo.child, options, "", @intCast(c_int, index), value_to_bind); | ||
| 1756 | } | ||
| 1757 | }, | ||
| 1753 | else => @compileError("Unsupported type for values: " ++ @typeName(StructType)), | 1758 | else => @compileError("Unsupported type for values: " ++ @typeName(StructType)), |
| 1754 | } | 1759 | } |
| 1755 | } | 1760 | } |