Skip to content

Commit 39237dc

Browse files
committed
dynamic statement: add prepareWithTail
1 parent 27d10c1 commit 39237dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sqlite.zig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,10 @@ pub const DynamicStatement = struct {
15681568
pub const PrepareError = error{EmptyQuery} || Error;
15691569

15701570
fn prepare(db: *Db, query: []const u8, options: QueryOptions, flags: c_uint) PrepareError!Self {
1571+
return prepareWithTail(db, query, options, flags, null);
1572+
}
1573+
1574+
fn prepareWithTail(db: *Db, query: []const u8, options: QueryOptions, flags: c_uint, tail: ?*[*c]const u8) PrepareError!Self {
15711575
var dummy_diags = Diagnostics{};
15721576
var diags = options.diags orelse &dummy_diags;
15731577
const stmt = blk: {
@@ -1578,7 +1582,7 @@ pub const DynamicStatement = struct {
15781582
@intCast(query.len),
15791583
flags,
15801584
&tmp,
1581-
options.sql_tail_ptr,
1585+
tail,
15821586
);
15831587
if (result != c.SQLITE_OK) {
15841588
diags.err = getLastDetailedErrorFromDb(db.db);

0 commit comments

Comments
 (0)