summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2020-12-28 00:32:15 +0100
committerGravatar Vincent Rischmann2020-12-30 15:19:09 +0100
commit1eeae525d8d150382f69be3537f70ebb970021b2 (patch)
treed817501c1f7583db5558f88720264a7594d2b59b
parentdocument ThreadingMode and InitOptions (diff)
downloadzig-sqlite-1eeae525d8d150382f69be3537f70ebb970021b2.tar.gz
zig-sqlite-1eeae525d8d150382f69be3537f70ebb970021b2.tar.xz
zig-sqlite-1eeae525d8d150382f69be3537f70ebb970021b2.zip
update readme for Db.init
-rw-r--r--README.md13
1 files changed, 10 insertions, 3 deletions
diff --git a/README.md b/README.md
index a27679c..452e3e7 100644
--- a/README.md
+++ b/README.md
@@ -51,12 +51,19 @@ You must create and initialize an instance of `sqlite.Db`:
51 51
52```zig 52```zig
53var db: sqlite.Db = undefined; 53var db: sqlite.Db = undefined;
54try db.init(allocator, .{ .mode = sqlite.Db.Mode{ .File = "/home/vincent/mydata.db" } }); 54try db.init(allocator, .{
55 .mode = sqlite.Db.Mode{ .File = "/home/vincent/mydata.db" },
56 .open_flags = .{
57 .write = true,
58 .create = true,
59 },
60 .threading_mode = .MultiThread,
61});
55``` 62```
56 63
57The `init` method takes an allocator and an optional tuple which will be used to configure sqlite. 64The `init` method takes an allocator and a `InitOptions` struct which will be used to configure sqlite.
58 65
59Right now the only member used in that tuple is `mode` which defines if the sqlite database is in memory or uses a file. 66Only the `mode` field is mandatory, the other fields have sane default values.
60 67
61### Preparing a statement 68### Preparing a statement
62 69