@@ -6,6 +6,7 @@ | |||
#include <dds/error/errors.hpp> | |||
#include <dds/solve/solve.hpp> | |||
#include <dds/util/log.hpp> | |||
#include <dds/util/paths.hpp> | |||
#include <json5/parse_data.hpp> | |||
#include <neo/assert.hpp> | |||
@@ -279,6 +280,8 @@ void ensure_migrated(nsql::database& db) { | |||
} // namespace | |||
fs::path catalog::default_path() noexcept { return dds_data_dir() / "catalog.db"; } | |||
catalog catalog::open(const std::string& db_path) { | |||
if (db_path != ":memory:") { | |||
auto pardir = fs::weakly_canonical(db_path).parent_path(); |
@@ -32,6 +32,8 @@ public: | |||
static catalog open(const std::string& db_path); | |||
static catalog open(path_ref db_path) { return open(db_path.string()); } | |||
static fs::path default_path() noexcept; | |||
void store(const package_info& info); | |||
std::optional<package_info> get(const package_id& id) const noexcept; | |||