From 6a6bacf975156a045cf48f9e58520f0bc0f54429 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 12 Jun 2021 16:32:13 +0200 Subject: 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. --- src/database.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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, )?, } ) -- cgit v1.2.3