summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index f1f2e09..1551cc0 100644
--- a/README.md
+++ b/README.md
@@ -104,6 +104,19 @@ defer stmt.deinit();
104 104
105The `Db.prepare` method takes a `comptime` query string. 105The `Db.prepare` method takes a `comptime` query string.
106 106
107### Diagnostics
108
109If you want failure diagnostics you can use `prepareWithDiags` like this:
110
111```zig
112var diags = sqlite.Diagnostics{};
113var stmt = db.prepareWithDiags(query, .{ .diags = &diags }) catch |err| {
114 std.log.err("unable to prepare statement, got error {s}. diagnostics: {s}", .{ err, diags });
115 return err;
116};
117defer stmt.deinit();
118```
119
107## Executing a statement 120## Executing a statement
108 121
109For queries which do not return data (`INSERT`, `UPDATE`) you can use the `exec` method: 122For queries which do not return data (`INSERT`, `UPDATE`) you can use the `exec` method: