We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a493591 commit 2eefd69Copy full SHA for 2eefd69
models/user/user.go
@@ -834,7 +834,8 @@ type CountUserFilter struct {
834
// HasUsers checks whether there are any users in the database, or only one user exists.
835
func HasUsers(ctx context.Context) (ret struct {
836
HasAnyUser, HasOnlyOneUser bool
837
-}, err error) {
+}, err error,
838
+) {
839
res, err := db.GetEngine(ctx).Table(&User{}).Cols("id").Limit(2).Query()
840
if err != nil {
841
return ret, fmt.Errorf("error checking user existence: %w", err)
0 commit comments