refactor
This commit is contained in:
		| @@ -31,15 +31,16 @@ namespace repertory::db { | ||||
|     sqlite3_free(err_msg); | ||||
|     err_msg = nullptr; | ||||
|   } | ||||
|   if (res != SQLITE_OK) { | ||||
|  | ||||
|   if (res == SQLITE_OK) { | ||||
|     return true; | ||||
|   } | ||||
|  | ||||
|   err = "failed to execute sql|" + sql + "|" + std::to_string(res) + '|' + | ||||
|         (err.empty() ? sqlite3_errstr(res) : err); | ||||
|   return false; | ||||
| } | ||||
|  | ||||
|   return true; | ||||
| } | ||||
|  | ||||
| void set_journal_mode(sqlite3 &db3) { | ||||
|   sqlite3_exec(&db3, "PRAGMA journal_mode = WAL;PRAGMA synchronous = NORMAL;", | ||||
|                nullptr, nullptr, nullptr); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user