code: func GetGatewayProfile(db sqlx.Queryer, id uuid.UUID) (GatewayProfile, error) {
  	var c GatewayProfile
  	err := db.QueryRowx(`
  		select
  			gateway_profile_id,
  			created_at,
  			updated_at,
  			channels
  		from gateway_profile
  		where
  			gateway_profile_id = $1`,
  		id,
  	).Scan(
  		&c.ID,
  		&c.CreatedAt,
  		&c.UpdatedAt,
  		pq.Array(&c.Channels),
  	)
  	if err != nil {
  		return c, handlePSQLError(err, "select error")
  	}
  
  	rows, err := db.Query(`
  		select
  			modulation,
  			frequency,
  			bandwidth,
  			bitrate,
  			spreading_factors
  		from gateway_profile_extra_channel
  		where
  			gateway_profile_id = $1
  		order by id`,
  		id,
  	)
  	if err != nil {
  		return c, handlePSQLError(err, "select error")
  	}
  	defer rows.Close()
  
  	for rows.Next() {
  		var ec ExtraChannel
  		err := rows.Scan(
  			&ec.Modulation,
  			&ec.Frequency,
  			&ec.Bandwidth,
  			&ec.Bitrate,
  			pq.Array(&ec.SpreadingFactors),
  		)
  		if err != nil {
  			return c, handlePSQLError(err, "select error")
  		}
  		c.ExtraChannels = append(c.ExtraChannels, ec)
  	}
  
  	return c, nil
  }
docs: // GetGatewayProfile returns the gateway-profile matching the
  // given ID.