From 39237dc9a467a83814eac6fba7863f243fadae8c Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Thu, 19 Dec 2024 01:02:17 +0100 Subject: dynamic statement: add prepareWithTail --- sqlite.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sqlite.zig b/sqlite.zig index 6d22d1f..b1f9f81 100644 --- a/sqlite.zig +++ b/sqlite.zig @@ -1568,6 +1568,10 @@ pub const DynamicStatement = struct { pub const PrepareError = error{EmptyQuery} || Error; fn prepare(db: *Db, query: []const u8, options: QueryOptions, flags: c_uint) PrepareError!Self { + return prepareWithTail(db, query, options, flags, null); + } + + fn prepareWithTail(db: *Db, query: []const u8, options: QueryOptions, flags: c_uint, tail: ?*[*c]const u8) PrepareError!Self { var dummy_diags = Diagnostics{}; var diags = options.diags orelse &dummy_diags; const stmt = blk: { @@ -1578,7 +1582,7 @@ pub const DynamicStatement = struct { @intCast(query.len), flags, &tmp, - options.sql_tail_ptr, + tail, ); if (result != c.SQLITE_OK) { diags.err = getLastDetailedErrorFromDb(db.db); -- cgit v1.2.3