diff options
| author | 2021-11-22 23:21:01 +0100 | |
|---|---|---|
| committer | 2021-11-22 23:34:41 +0100 | |
| commit | 3dc73fbe5bbe043e31b12637cb693b9bf6ceba95 (patch) | |
| tree | e99ac13ef7635d7ffe9c5ed9f995c7bde81e2ea0 /sqlite.zig | |
| parent | dynamic statement: document bind() (diff) | |
| download | zig-sqlite-3dc73fbe5bbe043e31b12637cb693b9bf6ceba95.tar.gz zig-sqlite-3dc73fbe5bbe043e31b12637cb693b9bf6ceba95.tar.xz zig-sqlite-3dc73fbe5bbe043e31b12637cb693b9bf6ceba95.zip | |
dynamic statement: fix documentation
Diffstat (limited to 'sqlite.zig')
| -rw-r--r-- | sqlite.zig | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -1208,9 +1208,11 @@ pub const StatementOptions = struct {}; | |||
| 1208 | /// const stmt = "SELECT email FROM users WHERE name = ? AND password = ?"; | 1208 | /// const stmt = "SELECT email FROM users WHERE name = ? AND password = ?"; |
| 1209 | /// const row = try stmt.one(Row, .{"Tankman", "Passw0rd"}); | 1209 | /// const row = try stmt.one(Row, .{"Tankman", "Passw0rd"}); |
| 1210 | /// | 1210 | /// |
| 1211 | /// TODO(vincent): clarify the following | 1211 | /// You can only mix named and unnamed bind markers if: |
| 1212 | /// Named and unnamed markers could not be mixed, functions might be failed in slient. | 1212 | /// * the bind values data is a tuple (without field names) |
| 1213 | /// (Just like sqlite3's sqlite3_stmt, the unbinded values will be treated as NULL.) | 1213 | /// * the bind values data is a struct with the same field orders as in the query |
| 1214 | /// This is because with a unnamed bind markers we use the field index in the struct as bind column; if the fields | ||
| 1215 | /// are in the wrong order the query will not work correctly. | ||
| 1214 | /// | 1216 | /// |
| 1215 | pub const DynamicStatement = struct { | 1217 | pub const DynamicStatement = struct { |
| 1216 | db: *c.sqlite3, | 1218 | db: *c.sqlite3, |