lmdb: Enable versioning for objects we'd like to store in the DB

This commit is contained in:
Martchus 2022-01-18 22:48:34 +01:00
parent 879c8824a4
commit e44cbf94e5
5 changed files with 16 additions and 16 deletions

View File

@ -83,7 +83,7 @@ struct LIBPKG_EXPORT CommonLicense : public ReflectiveRapidJSON::JsonSerializabl
};
struct LIBPKG_EXPORT LicenseResult : public ReflectiveRapidJSON::JsonSerializable<LicenseResult>,
public ReflectiveRapidJSON::BinarySerializable<LicenseResult> {
public ReflectiveRapidJSON::BinarySerializable<LicenseResult, 1> {
std::map<std::string, CommonLicense> commonLicenses;
std::map<std::string, std::vector<LicenseFile>> customLicences;
std::vector<std::string> consideredPackages;

View File

@ -76,7 +76,7 @@ struct LIBPKG_EXPORT PackageUpdate : public ReflectiveRapidJSON::JsonSerializabl
};
struct LIBPKG_EXPORT PackageUpdates : public ReflectiveRapidJSON::JsonSerializable<PackageUpdates>,
public ReflectiveRapidJSON::BinarySerializable<PackageUpdates> {
public ReflectiveRapidJSON::BinarySerializable<PackageUpdates, 1> {
std::vector<PackageUpdate> versionUpdates;
std::vector<PackageUpdate> packageUpdates;
std::vector<PackageUpdate> downgrades;
@ -91,7 +91,7 @@ struct LIBPKG_EXPORT PackageLocation {
};
struct LIBPKG_EXPORT UnresolvedDependencies : public ReflectiveRapidJSON::JsonSerializable<UnresolvedDependencies>,
public ReflectiveRapidJSON::BinarySerializable<UnresolvedDependencies> {
public ReflectiveRapidJSON::BinarySerializable<UnresolvedDependencies, 1> {
std::vector<Dependency> deps;
std::vector<std::string> libs;
};

View File

@ -146,7 +146,7 @@ inline Dependency Dependency::fromString(std::string_view dependency)
struct LIBPKG_EXPORT DatabaseDependency : public Dependency,
public ReflectiveRapidJSON::JsonSerializable<DatabaseDependency>,
public ReflectiveRapidJSON::BinarySerializable<DatabaseDependency> {
public ReflectiveRapidJSON::BinarySerializable<DatabaseDependency, 1> {
explicit DatabaseDependency() = default;
explicit DatabaseDependency(const std::string &name, const std::string &version, DependencyMode mode);
explicit DatabaseDependency(std::string &&name, std::string &&version, DependencyMode mode);
@ -164,7 +164,7 @@ inline DatabaseDependency::DatabaseDependency(const std::string &name, const std
}
struct LIBPKG_EXPORT DatabaseLibraryDependency : public ReflectiveRapidJSON::JsonSerializable<DatabaseLibraryDependency>,
public ReflectiveRapidJSON::BinarySerializable<DatabaseLibraryDependency> {
public ReflectiveRapidJSON::BinarySerializable<DatabaseLibraryDependency, 1> {
explicit DatabaseLibraryDependency() = default;
explicit DatabaseLibraryDependency(const std::string &name);
std::string name;
@ -369,7 +369,7 @@ template <> struct hash<LibPkg::PackageSpec> {
namespace LibPkg {
struct LIBPKG_EXPORT Package : public ReflectiveRapidJSON::JsonSerializable<Package>, public ReflectiveRapidJSON::BinarySerializable<Package> {
struct LIBPKG_EXPORT Package : public ReflectiveRapidJSON::JsonSerializable<Package>, public ReflectiveRapidJSON::BinarySerializable<Package, 1> {
Package() = default;
Package(const Package &other);
Package(Package &&other) = default;

View File

@ -71,7 +71,7 @@ set(META_APP_DESCRIPTION "Library for managing custom Arch Linux repositories")
set(META_VERSION_MAJOR 0)
set(META_VERSION_MINOR 0)
set(META_VERSION_PATCH 1)
set(META_VERSION_CACHE 10)
set(META_VERSION_CACHE 11)
set(META_VERSION_BUILD_ACTIONS_JSON 0)
set(META_VERSION_LIBRARY_DEPENDENCIES_JSON 0)
set(LINK_TESTS_AGAINST_APP_TARGET ON)

View File

@ -50,7 +50,7 @@ struct InternalBuildAction;
using AssociatedLocks = std::vector<std::variant<SharedLoggingLock, UniqueLoggingLock>>;
struct LIBREPOMGR_EXPORT PackageBuildData : public ReflectiveRapidJSON::JsonSerializable<PackageBuildData>,
public ReflectiveRapidJSON::BinarySerializable<PackageBuildData> {
public ReflectiveRapidJSON::BinarySerializable<PackageBuildData, 1> {
std::string existingVersion;
std::vector<std::shared_ptr<LibPkg::Package>> existingPackages;
std::string sourceDirectory;
@ -64,7 +64,7 @@ struct LIBREPOMGR_EXPORT PackageBuildData : public ReflectiveRapidJSON::JsonSeri
};
struct LIBREPOMGR_EXPORT BuildPreparation : public ReflectiveRapidJSON::JsonSerializable<BuildPreparation>,
public ReflectiveRapidJSON::BinarySerializable<BuildPreparation> {
public ReflectiveRapidJSON::BinarySerializable<BuildPreparation, 1> {
std::unordered_map<std::string, PackageBuildData> buildData;
std::vector<std::pair<std::string, std::multimap<std::string, std::string>>> dbConfig, stagingDbConfig;
std::string targetDb, targetArch, stagingDb;
@ -82,7 +82,7 @@ enum class PackageStagingNeeded {
};
struct LIBREPOMGR_EXPORT PackageBuildProgress : public ReflectiveRapidJSON::JsonSerializable<PackageBuildProgress>,
public ReflectiveRapidJSON::BinarySerializable<PackageBuildProgress> {
public ReflectiveRapidJSON::BinarySerializable<PackageBuildProgress, 1> {
bool hasBeenAnyProgressMade() const;
void resetProgress();
void resetChrootSettings();
@ -108,7 +108,7 @@ struct LIBREPOMGR_EXPORT PackageBuildProgress : public ReflectiveRapidJSON::Json
};
struct LIBREPOMGR_EXPORT RebuildInfo : public ReflectiveRapidJSON::JsonSerializable<RebuildInfo>,
public ReflectiveRapidJSON::BinarySerializable<RebuildInfo> {
public ReflectiveRapidJSON::BinarySerializable<RebuildInfo, 1> {
std::vector<LibPkg::Dependency> provides;
std::vector<std::string> libprovides;
@ -120,7 +120,7 @@ using RebuildInfoByPackage = std::unordered_map<std::string, RebuildInfo>;
using RebuildInfoByDatabase = std::unordered_map<std::string, RebuildInfoByPackage>;
struct LIBREPOMGR_EXPORT BuildProgress : public ReflectiveRapidJSON::JsonSerializable<BuildProgress>,
public ReflectiveRapidJSON::BinarySerializable<BuildProgress> {
public ReflectiveRapidJSON::BinarySerializable<BuildProgress, 1> {
std::unordered_map<std::string, PackageBuildProgress> progressByPackage;
std::string targetDbFilePath;
std::string targetRepoPath;
@ -131,21 +131,21 @@ struct LIBREPOMGR_EXPORT BuildProgress : public ReflectiveRapidJSON::JsonSeriali
};
struct LIBREPOMGR_EXPORT PackageMovementResult : public ReflectiveRapidJSON::JsonSerializable<PackageMovementResult>,
public ReflectiveRapidJSON::BinarySerializable<PackageMovementResult> {
public ReflectiveRapidJSON::BinarySerializable<PackageMovementResult, 1> {
std::vector<std::pair<std::string, std::string>> failedPackages;
std::vector<std::string> processedPackages;
std::string errorMessage;
};
struct LIBREPOMGR_EXPORT RepositoryProblem : public ReflectiveRapidJSON::JsonSerializable<RepositoryProblem>,
public ReflectiveRapidJSON::BinarySerializable<RepositoryProblem> {
public ReflectiveRapidJSON::BinarySerializable<RepositoryProblem, 1> {
std::variant<std::string, LibPkg::UnresolvedDependencies> desc;
std::string pkg;
bool critical = true;
};
struct LIBREPOMGR_EXPORT BuildActionMessages : public ReflectiveRapidJSON::JsonSerializable<BuildActionMessages>,
public ReflectiveRapidJSON::BinarySerializable<BuildActionMessages> {
public ReflectiveRapidJSON::BinarySerializable<BuildActionMessages, 1> {
std::vector<std::string> notes;
std::vector<std::string> warnings;
std::vector<std::string> errors;
@ -157,7 +157,7 @@ struct ServiceSetup;
struct LIBREPOMGR_EXPORT BuildAction : public std::enable_shared_from_this<BuildAction>,
public ReflectiveRapidJSON::JsonSerializable<BuildAction>,
public ReflectiveRapidJSON::BinarySerializable<BuildAction> {
public ReflectiveRapidJSON::BinarySerializable<BuildAction, 1> {
friend InternalBuildAction;
friend ServiceSetup;
friend BuildProcessSession;