code: func (q DomainsQuery) scope(db *gorm.DB) *gorm.DB {
  	var scope composedScope
  
  	if q.Hostname != nil {
  		scope = append(scope, fieldEquals("hostname", *q.Hostname))
  	}
  
  	if q.App != nil {
  		scope = append(scope, forApp(q.App))
  	}
  
  	return scope.scope(db)
  }
docs: // scope implements the scope interface.