diff options
| author | 2021-10-18 19:25:01 +0200 | |
|---|---|---|
| committer | 2021-10-18 21:26:06 +0200 | |
| commit | 9e8829fa7440c2cc08cf943a78a0dffc9c471cd6 (patch) | |
| tree | 8a87d5f0ac93f708fc27d996446656c5554de455 /sqlite.zig | |
| parent | improve documentation of DynamicStatement (diff) | |
| download | zig-sqlite-9e8829fa7440c2cc08cf943a78a0dffc9c471cd6.tar.gz zig-sqlite-9e8829fa7440c2cc08cf943a78a0dffc9c471cd6.tar.xz zig-sqlite-9e8829fa7440c2cc08cf943a78a0dffc9c471cd6.zip | |
no need for comptimePrint here
Diffstat (limited to '')
| -rw-r--r-- | sqlite.zig | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -1209,7 +1209,7 @@ pub const DynamicStatement = struct { | |||
| 1209 | 1209 | ||
| 1210 | fn sqlite3BindParameterIndex(stmt: *c.sqlite3_stmt, comptime name: []const u8) c_int { | 1210 | fn sqlite3BindParameterIndex(stmt: *c.sqlite3_stmt, comptime name: []const u8) c_int { |
| 1211 | inline for (.{ ":", "@", "$" }) |prefix| { | 1211 | inline for (.{ ":", "@", "$" }) |prefix| { |
| 1212 | const id = std.fmt.comptimePrint(prefix ++ "{s}", .{name}); | 1212 | const id = prefix ++ name; |
| 1213 | const i = c.sqlite3_bind_parameter_index(stmt, id); | 1213 | const i = c.sqlite3_bind_parameter_index(stmt, id); |
| 1214 | if (i > 0) return i - 1; // .bindField uses 0-based while sqlite3 uses 1-based index. | 1214 | if (i > 0) return i - 1; // .bindField uses 0-based while sqlite3 uses 1-based index. |
| 1215 | } | 1215 | } |