mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Use fs::path instead of std::filesystem
This uses the ghc filesystem backport when targetting older mac, and std::filesystem everywhere else.
This commit is contained in:
parent
f8c47ba1f7
commit
25285dacc1
1 changed files with 4 additions and 3 deletions
|
@ -9,13 +9,14 @@
|
|||
#include <chrono>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <filesystem>
|
||||
#include <string_view>
|
||||
#include <shared_mutex>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
#include <optional>
|
||||
|
||||
#include "common/fs.h"
|
||||
|
||||
namespace db
|
||||
{
|
||||
template <typename T>
|
||||
|
@ -284,8 +285,8 @@ namespace db
|
|||
return exec_and_maybe_get<T...>(prepared_st(query), bind...);
|
||||
}
|
||||
|
||||
explicit Database(const std::filesystem::path& db_path, const std::string_view db_password)
|
||||
: db{db_path, SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE | SQLite::OPEN_FULLMUTEX, 5000/*ms*/}
|
||||
explicit Database(const fs::path& db_path, const std::string_view db_password)
|
||||
: db{db_path.u8path(), SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE | SQLite::OPEN_FULLMUTEX, 5000/*ms*/}
|
||||
{
|
||||
// Don't fail on these because we can still work even if they fail
|
||||
if (int rc = db.tryExec("PRAGMA journal_mode = WAL"); rc != SQLITE_OK)
|
||||
|
|
Loading…
Reference in a new issue