From 1eeae525d8d150382f69be3537f70ebb970021b2 Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Mon, 28 Dec 2020 00:32:15 +0100 Subject: update readme for Db.init --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'README.md') 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`: ```zig var db: sqlite.Db = undefined; -try db.init(allocator, .{ .mode = sqlite.Db.Mode{ .File = "/home/vincent/mydata.db" } }); +try db.init(allocator, .{ + .mode = sqlite.Db.Mode{ .File = "/home/vincent/mydata.db" }, + .open_flags = .{ + .write = true, + .create = true, + }, + .threading_mode = .MultiThread, +}); ``` -The `init` method takes an allocator and an optional tuple which will be used to configure sqlite. +The `init` method takes an allocator and a `InitOptions` struct which will be used to configure sqlite. -Right now the only member used in that tuple is `mode` which defines if the sqlite database is in memory or uses a file. +Only the `mode` field is mandatory, the other fields have sane default values. ### Preparing a statement -- cgit v1.2.3