diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 13 |
1 files changed, 10 insertions, 3 deletions
| @@ -51,12 +51,19 @@ You must create and initialize an instance of `sqlite.Db`: | |||
| 51 | 51 | ||
| 52 | ```zig | 52 | ```zig |
| 53 | var db: sqlite.Db = undefined; | 53 | var db: sqlite.Db = undefined; |
| 54 | try db.init(allocator, .{ .mode = sqlite.Db.Mode{ .File = "/home/vincent/mydata.db" } }); | 54 | try 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 | ||
| 57 | The `init` method takes an allocator and an optional tuple which will be used to configure sqlite. | 64 | The `init` method takes an allocator and a `InitOptions` struct which will be used to configure sqlite. |
| 58 | 65 | ||
| 59 | Right now the only member used in that tuple is `mode` which defines if the sqlite database is in memory or uses a file. | 66 | Only the `mode` field is mandatory, the other fields have sane default values. |
| 60 | 67 | ||
| 61 | ### Preparing a statement | 68 | ### Preparing a statement |
| 62 | 69 | ||