From 36e7e6f8847dd53fc02818d51f30e7887d6bfff3 Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Tue, 19 Nov 2024 16:17:36 +0500 Subject: [PATCH] feat(be): user count implementation for boltdb --- db/bolt/user.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/bolt/user.go b/db/bolt/user.go index 4f59de52..de130eb2 100644 --- a/db/bolt/user.go +++ b/db/bolt/user.go @@ -177,6 +177,12 @@ func (d *BoltDb) GetUser(userID int) (user db.User, err error) { } func (d *BoltDb) GetUserCount() (count int, err error) { + var users []db.User + err = d.getObjects(0, db.UserProps, db.RetrieveQueryParams{}, nil, &users) + if err != nil { + return + } + count = len(users) return }