-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
type:missing reproduction stepsmissing reproduction stepsmissing reproduction steps
Description
GORM Playground Link
Description
gorm v1.30.5 give error into method Count
gorm.GE.Count undefined (type gorm.Interface[E] has no field or method Count) (compiler MissingFieldOrMethod)
code production
func (r *BaseRepository[E, I]) List(ctx context.Context, limit, offset int) ([]*E, int64, error) {
count, err := gorm.G[E](r.db).Count(ctx, "id")
if err != nil {
return nil, 0, err
}
entities, err := gorm.G[*E](r.db).Offset(offset).Limit(limit).Find(ctx)
if err != nil {
return nil, 0, err
}
return entities, count, nil
}before v1.30.5 no error on v1.30.3 using API Generics
Metadata
Metadata
Assignees
Labels
type:missing reproduction stepsmissing reproduction stepsmissing reproduction steps