code: func (q *Query) Relation(name string, apply ...func(*Query) (*Query, error)) *Query {
  	var fn func(*Query) (*Query, error)
  	if len(apply) == 1 {
  		fn = apply[0]
  	} else if len(apply) > 1 {
  		panic("only one apply function is supported")
  	}
  
  	join := q.model.Join(name, fn)
  	if join == nil {
  		return q.err(fmt.Errorf("%s does not have relation=%q",
  			q.model.Table(), name))
  	}
  
  	if fn == nil {
  		return q
  	}
  
  	switch join.Rel.Type {
  	case HasOneRelation, BelongsToRelation:
  		q.joinAppendOn = join.AppendOn
  		return q.Apply(fn)
  	default:
  		q.joinAppendOn = nil
  		return q
  	}
  }
docs: // Relation adds a relation to the query. Relation name can be:
  //   - RelationName to select all columns,
  //   - RelationName.column_name,
  //   - RelationName._ to join relation without selecting relation columns.