code: func listRacks(c context.Context, req *crimson.ListRacksRequest) ([]*crimson.Rack, error) {
  	stmt := squirrel.Select("r.name", "r.description", "r.state", "d.name", "h.name").
  		From("(racks r, datacenters d)").
  		LeftJoin("kvms k ON r.kvm_id = k.id").
  		LeftJoin("hostnames h ON k.hostname_id = h.id").
  		Where("r.datacenter_id = d.id")
  	stmt = selectInString(stmt, "r.name", req.Names)
  	stmt = selectInString(stmt, "d.name", req.Datacenters)
  	stmt = selectInString(stmt, "h.name", req.Kvms)
  	query, args, err := stmt.ToSql()
  	if err != nil {
  		return nil, errors.Annotate(err, "failed to generate statement").Err()
  	}
  
  	db := database.Get(c)
  	rows, err := db.QueryContext(c, query, args...)
  	if err != nil {
  		return nil, errors.Annotate(err, "failed to fetch racks").Err()
  	}
  	defer rows.Close()
  
  	var racks []*crimson.Rack
  	for rows.Next() {
  		rack := &crimson.Rack{}
  		var kvm sql.NullString
  		if err = rows.Scan(&rack.Name, &rack.Description, &rack.State, &rack.Datacenter, &kvm); err != nil {
  			return nil, errors.Annotate(err, "failed to fetch rack").Err()
  		}
  		if kvm.Valid {
  			rack.Kvm = kvm.String
  		}
  		racks = append(racks, rack)
  	}
  	return racks, nil
  }
docs: // listRacks returns a slice of racks in the database.