mirror of https://github.com/waku-org/nwaku.git
feat(store): add support for getting stored messages count
This commit is contained in:
parent
83cffd50ed
commit
9561f12172
|
@ -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…
Reference in New Issue