diff options
| author | 2024-04-14 19:26:44 +0200 | |
|---|---|---|
| committer | 2024-04-14 19:31:53 +0200 | |
| commit | a1c695f5be5178cefaa22aac22dff0480a29e61f (patch) | |
| tree | 275544d58a5b35ef99475032eefd210fd584839c /sqlite.zig | |
| parent | build: add the workaround C file (diff) | |
| download | zig-sqlite-a1c695f5be5178cefaa22aac22dff0480a29e61f.tar.gz zig-sqlite-a1c695f5be5178cefaa22aac22dff0480a29e61f.tar.xz zig-sqlite-a1c695f5be5178cefaa22aac22dff0480a29e61f.zip | |
all: use our workaround function for SQLITE_TRANSIENT
Diffstat (limited to '')
| -rw-r--r-- | sqlite.zig | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -1676,7 +1676,7 @@ pub const DynamicStatement = struct { | |||
| 1676 | const data: []const u8 = field[0..field.len]; | 1676 | const data: []const u8 = field[0..field.len]; |
| 1677 | 1677 | ||
| 1678 | // NOTE(vincent): The array is temporary and must be copied, therefore we use SQLITE_TRANSIENT | 1678 | // NOTE(vincent): The array is temporary and must be copied, therefore we use SQLITE_TRANSIENT |
| 1679 | const result = c.sqlite3_bind_text(self.stmt, column, data.ptr, @intCast(data.len), c.SQLITE_TRANSIENT); | 1679 | const result = c.sqlite3_bind_text(self.stmt, column, data.ptr, @intCast(data.len), c.sqliteTransientAsDestructor()); |
| 1680 | return convertResultToError(result); | 1680 | return convertResultToError(result); |
| 1681 | }, | 1681 | }, |
| 1682 | else => @compileError("cannot bind field " ++ field_name ++ " of type array of " ++ @typeName(arr.child)), | 1682 | else => @compileError("cannot bind field " ++ field_name ++ " of type array of " ++ @typeName(arr.child)), |