Check for read-only DB

This commit is contained in:
Jonathan Bennett
2025-12-28 14:12:01 -06:00
parent 0228d4e2df
commit 4e30795c6b

View File

@@ -34,6 +34,12 @@ StoreForwardPlusPlusModule::StoreForwardPlusPlusModule()
ppDb = nullptr;
exit(EXIT_FAILURE);
}
if (sqlite3_db_readonly(ppDb, "main")) {
LOG_ERROR("Database opened read-only!");
sqlite3_close(ppDb);
ppDb = nullptr;
exit(EXIT_FAILURE);
}
LOG_WARN("Result1 %u", res);
char *err = nullptr;