mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-17 05:13:09 +00:00
feat(store): add support for getting stored messages count
This commit is contained in:
parent
1519a6ac79
commit
bcc99a9998
@ -45,3 +45,5 @@ method getMessagesByHistoryQuery*(
|
||||
maxPageSize = StoreMaxPageSize,
|
||||
ascendingOrder = true
|
||||
): MessageStoreResult[MessageStorePage] {.base.} = discard
|
||||
|
||||
method getMessagesCount*(ms: MessageStore): int64 {.base.} = discard
|
||||
|
||||
@ -156,6 +156,8 @@ method getMessagesByHistoryQuery*(
|
||||
|
||||
ok((messages, some(pagingInfo)))
|
||||
|
||||
method getMessagesCount*(s: SqliteStore): int64 =
|
||||
int64(s.numMessages)
|
||||
|
||||
proc close*(s: SqliteStore) =
|
||||
## Close the database connection
|
||||
|
||||
@ -425,3 +425,6 @@ method getMessagesByHistoryQuery*(
|
||||
return ok((messages, none(PagingInfo)))
|
||||
|
||||
ok((messages, some(pagingInfo)))
|
||||
|
||||
method getMessagesCount*(storeQueue: StoreQueueRef): int64 =
|
||||
int64(storeQueue.len())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user