New Storage Refactor #404
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue