summaryrefslogtreecommitdiff
path: root/sqlite.zig
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-04-14 20:50:44 +0200
committerGravatar GitHub2024-04-14 20:50:44 +0200
commit19dd52b7b7e9fa5ec029c4ac3bd53fb41e5be12c (patch)
tree453f927a6926b4f778a4be2a14164896734a60f0 /sqlite.zig
parentMerge pull request #157 from vrischmann/update-latest-zig (diff)
parentci: run with -fqemu and -frosetta (diff)
downloadzig-sqlite-19dd52b7b7e9fa5ec029c4ac3bd53fb41e5be12c.tar.gz
zig-sqlite-19dd52b7b7e9fa5ec029c4ac3bd53fb41e5be12c.tar.xz
zig-sqlite-19dd52b7b7e9fa5ec029c4ac3bd53fb41e5be12c.zip
Merge pull request #158 from vrischmann/workaround-sqlite-transient
Workaround 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)),