BareGit
#pragma once

#include <filesystem>
#include <string>

#include <mw/database.hpp>
#include <mw/error.hpp>

namespace overseer::db
{

/// Create an online backup of the SQLite database at `db_path`, using
/// SQLite's `sqlite3_backup_*` API on the open connection `db`. The
/// destination path is `db_path + ".bak-" + YYYYmmdd-HHMMSS`.
///
/// Returns the path of the backup file on success.
mw::E<std::filesystem::path>
backupDatabaseFile(mw::SQLite& db, const std::string& db_path);

} // namespace overseer::db