aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-06-12 16:32:13 +0200
committerTeddy Wing2021-06-12 16:32:13 +0200
commit6a6bacf975156a045cf48f9e58520f0bc0f54429 (patch)
tree30a808bda0f1d4257b19ca8194a0f4638ee3309a
parent589545996e2b886e2c9e3ddb7b769d9e5e7959cf (diff)
downloadreflectub-6a6bacf975156a045cf48f9e58520f0bc0f54429.tar.bz2
Db::connect(): Fix database open call
Turns out I need to specify all the flag I want in the open call, including the one to open the database for reading and writing. This fixes the "Error code 21: Library used incorrectly" error I was getting earlier.
-rw-r--r--src/database.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/database.rs b/src/database.rs
index f23fcd4..0785dd5 100644
--- a/src/database.rs
+++ b/src/database.rs
@@ -70,7 +70,8 @@ impl Db {
Db {
connection: rusqlite::Connection::open_with_flags(
path,
- rusqlite::OpenFlags::SQLITE_OPEN_CREATE,
+ rusqlite::OpenFlags::SQLITE_OPEN_READ_WRITE
+ | rusqlite::OpenFlags::SQLITE_OPEN_CREATE,
)?,
}
)