MCPcopy Create free account
hub / github.com/CommE2E/comm / replaceThread

Method replaceThread

native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp:590–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588};
589
590void SQLiteQueryExecutor::replaceThread(const Thread &thread, bool backupItem)
591 const {
592 std::string tableName = backupItem ? "backup_threads" : "threads";
593 std::string replaceThreadSQL = "REPLACE INTO " + tableName +
594 "("
595 " id, type, name, description, color, creation_time, parent_thread_id,"
596 " containing_thread_id, community, members, roles, current_user,"
597 " source_message_id, replies_count, avatar, pinned_count, timestamps,"
598 " pinned_message_ids) "
599 "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
600
601 replaceEntity<Thread>(this->getConnection(), replaceThreadSQL, thread);
602};
603
604void SQLiteQueryExecutor::removeAllThreads() const {
605 constexpr std::string_view tables[] = {"threads", "backup_threads"};

Callers 2

executeMethod · 0.45

Calls 1

getConnectionMethod · 0.95

Tested by

no test coverage detected