FOSSredder 0.5.0
Loading...
Searching...
No Matches
SqliteStatementDraftRepository.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:
24 explicit SqliteStatementDraftRepository(const std::string& dbPath);
25
31 explicit SqliteStatementDraftRepository(std::shared_ptr<SqliteDb> db);
32
37
43 const std::shared_ptr<
45
50 std::vector<
51 std::shared_ptr<core::application::importing::draft::StatementDraft>>
52 getStatementDrafts() const override;
53
59 std::optional<
60 std::shared_ptr<core::application::importing::draft::StatementDraft>>
61 getStatementDraftById(const std::string& id) const override;
62
67 void removeStatementDraft(const std::string& id) override;
68
74 const std::shared_ptr<
76
82 const std::shared_ptr<
84
88 void clearStatementDrafts() override;
89
90private:
91 struct Impl;
92 std::unique_ptr<Impl> pimpl_;
93};
Repository port for statement draft persistence operations.
void removeStatementDraft(const std::string &id) override
Remove a statement draft by identifier.
void addStatementDraft(const std::shared_ptr< core::application::importing::draft::StatementDraft > &draft) override
Insert a new statement draft.
void upsertStatementDraft(const std::shared_ptr< core::application::importing::draft::StatementDraft > &draft) override
Insert or update a statement draft.
SqliteStatementDraftRepository(const std::string &dbPath)
Create a statement draft repository for the database at the given path.
std::optional< std::shared_ptr< core::application::importing::draft::StatementDraft > > getStatementDraftById(const std::string &id) const override
Retrieve a statement draft by identifier.
void updateStatementDraft(const std::shared_ptr< core::application::importing::draft::StatementDraft > &draft) override
Update an existing statement draft.
std::vector< std::shared_ptr< core::application::importing::draft::StatementDraft > > getStatementDrafts() const override
Retrieve all statement drafts.
~SqliteStatementDraftRepository() override
Destroy the repository.
void clearStatementDrafts() override
Remove all statement drafts.