List returns all users (for admin).
(ctx context.Context, limit, offset int)
| 173 | |
| 174 | // List returns all users (for admin). |
| 175 | func (s *UsersStore) List(ctx context.Context, limit, offset int) ([]models.User, error) { |
| 176 | d := s.db.DB(ctx) |
| 177 | rows, err := d.Queries.ListUsers(ctx, db.ListUsersParams{Limit: safeconv.ClampToInt32(limit), Offset: safeconv.ClampToInt32(offset)}) |
| 178 | if err != nil { |
| 179 | return nil, err |
| 180 | } |
| 181 | out := make([]models.User, len(rows)) |
| 182 | for i := range rows { |
| 183 | out[i] = dbUserToModel(rows[i]) |
| 184 | } |
| 185 | return out, nil |
| 186 | } |
| 187 | |
| 188 | // Count returns total user count. |
| 189 | func (s *UsersStore) Count(ctx context.Context) (int, error) { |
nothing calls this directly
no test coverage detected