summaryrefslogtreecommitdiff
path: root/sqlite.zig
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-04-14 19:26:44 +0200
committerGravatar Vincent Rischmann2024-04-14 19:31:53 +0200
commita1c695f5be5178cefaa22aac22dff0480a29e61f (patch)
tree275544d58a5b35ef99475032eefd210fd584839c /sqlite.zig
parentbuild: add the workaround C file (diff)
downloadzig-sqlite-a1c695f5be5178cefaa22aac22dff0480a29e61f.tar.gz
zig-sqlite-a1c695f5be5178cefaa22aac22dff0480a29e61f.tar.xz
zig-sqlite-a1c695f5be5178cefaa22aac22dff0480a29e61f.zip
all: use our workaround function for SQLITE_TRANSIENT
Diffstat (limited to 'sqlite.zig')
-rw-r--r--sqlite.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/sqlite.zig b/sqlite.zig
index be46dea..bd11dea 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -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)),