Page MenuHomePhabricator

D4234.id13435.diff
No OneTemporary

D4234.id13435.diff

diff --git a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
@@ -25,6 +25,7 @@
class DatabaseQueryExecutor {
public:
virtual std::string getDraft(std::string key) const = 0;
+ virtual std::unique_ptr<Thread> getThread(std::string threadID) const = 0;
virtual void updateDraft(std::string key, std::string text) const = 0;
virtual bool moveDraft(std::string oldKey, std::string newKey) const = 0;
virtual std::vector<Draft> getAllDrafts() const = 0;
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
@@ -23,6 +23,7 @@
SQLiteQueryExecutor();
static void initialize(std::string &databasePath);
+ std::unique_ptr<Thread> getThread(std::string threadID) const override;
std::string getDraft(std::string key) const override;
void updateDraft(std::string key, std::string text) const override;
bool moveDraft(std::string oldKey, std::string newKey) const override;
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -546,6 +546,11 @@
return (draft == nullptr) ? "" : draft->text;
}
+std::unique_ptr<Thread>
+SQLiteQueryExecutor::getThread(std::string threadID) const {
+ return SQLiteQueryExecutor::getStorage().get_pointer<Thread>(threadID);
+}
+
void SQLiteQueryExecutor::updateDraft(std::string key, std::string text) const {
Draft draft = {key, text};
SQLiteQueryExecutor::getStorage().replace(draft);

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 7:27 PM (20 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594691
Default Alt Text
D4234.id13435.diff (1 KB)

Event Timeline