New Storage Refactor #404

Merged
sarah merged 33 commits from p2p-interim-new-storage into master 2021-11-25 23:56:51 +00:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit 1b9a9a0b72 - Show all commits

View File

@ -96,8 +96,8 @@ const getMessageBySignatureFromConversationSQLStmt = `select ID from channel_%d_
// getMessageByContentHashFromConversationSQLStmt is a template for selecting conversation messages by content hash
const getMessageByContentHashFromConversationSQLStmt = `select ID from channel_%d_%d_chat where ContentHash=(?) order by ID desc limit 1;`
// getLocalIndexOfMessageIdSQLStmt is a template for fetching the offset of a message from the bottom of the database.
const getLocalIndexOfMessageIdSQLStmt = `select count (*) from channel_%d_%d_chat where ID >= (?) order by ID desc;`
// getLocalIndexOfMessageIDSQLStmt is a template for fetching the offset of a message from the bottom of the database.
const getLocalIndexOfMessageIDSQLStmt = `select count (*) from channel_%d_%d_chat where ID >= (?) order by ID desc;`
// getMessageCountFromConversationSQLStmt is a template for fetching the count of a messages in a conversation channel
const getMessageCountFromConversationSQLStmt = `select count(*) from channel_%d_%d_chat;`
@ -546,7 +546,7 @@ func (cps *CwtchProfileStorage) GetRowNumberByMessageID(conversation int, channe
_, exists := cps.channelRowNumberStmts[channelID]
if !exists {
conversationStmt, err := cps.db.Prepare(fmt.Sprintf(getLocalIndexOfMessageIdSQLStmt, conversation, channel))
conversationStmt, err := cps.db.Prepare(fmt.Sprintf(getLocalIndexOfMessageIDSQLStmt, conversation, channel))
if err != nil {
log.Errorf("error executing transaction: %v", err)
return -1, err