FOSSredder 0.5.0
Loading...
Searching...
No Matches
SqliteImportLogRepository.h
Go to the documentation of this file.
1
6
7#pragma once
8
10
11#include <memory>
12#include <string>
13
14class SqliteDb;
15
18public:
23 explicit SqliteImportLogRepository(const std::string& dbPath);
24
30 explicit SqliteImportLogRepository(std::shared_ptr<SqliteDb> db);
31
36
41 void addImportLog(
42 const std::shared_ptr<core::application::importing::ImportLog>& log)
43 override;
44
49 std::vector<std::shared_ptr<core::application::importing::ImportLog>>
50 getImportLogs() const override;
51
57 std::optional<std::shared_ptr<core::application::importing::ImportLog>>
58 getImportLogById(const std::string& id) const override;
59
64 void removeImportLog(const std::string& id) override;
65
70 void updateImportLog(
71 const std::shared_ptr<core::application::importing::ImportLog>& log)
72 override;
73
78 void upsertImportLog(
79 const std::shared_ptr<core::application::importing::ImportLog>& log)
80 override;
81
85 void clearImportLogs() override;
86
87private:
88 struct Impl;
89 std::unique_ptr<Impl> pimpl_;
90};
Repository port for core::application::importing::ImportLog persistence operations.
void removeImportLog(const std::string &id) override
Remove an import log entry by identifier.
void addImportLog(const std::shared_ptr< core::application::importing::ImportLog > &log) override
Insert a new import log entry.
std::vector< std::shared_ptr< core::application::importing::ImportLog > > getImportLogs() const override
Retrieve all import log entries.
void upsertImportLog(const std::shared_ptr< core::application::importing::ImportLog > &log) override
Insert or update an import log entry.
void clearImportLogs() override
Remove all import log entries.
SqliteImportLogRepository(const std::string &dbPath)
Create an import log repository for the database at the given path.
~SqliteImportLogRepository() override
Destroy the repository.
void updateImportLog(const std::shared_ptr< core::application::importing::ImportLog > &log) override
Update an existing import log entry.
std::optional< std::shared_ptr< core::application::importing::ImportLog > > getImportLogById(const std::string &id) const override
Retrieve an import log entry by identifier.