I'm trying to get a count of rows with gorm
DB.Joins("left join cities on offices.city_id = cities.id").
Preload("City").
Limit(limit).Offset(offset).
Find(&offices, "cities.name LIKE ?", "%"+CityName+"%")
This is a query that finds rows and with offset. When I use Count here it returns limit.
Is there any way to get a count of every row but load the only limit? Or 2 query is unavoidable