code: func CreateGateway(db sqlx.Execer, gw *Gateway) error {
  	now := time.Now()
  	gw.CreatedAt = now
  	gw.UpdatedAt = now
  
  	_, err := db.Exec(`
  		insert into gateway (
  			gateway_id,
  			created_at,
  			updated_at,
  			first_seen_at,
  			last_seen_at,
  			location,
  			altitude,
  			gateway_profile_id
  		) values ($1, $2, $3, $4, $5, $6, $7, $8)`,
  		gw.GatewayID[:],
  		gw.CreatedAt,
  		gw.UpdatedAt,
  		gw.FirstSeenAt,
  		gw.LastSeenAt,
  		gw.Location,
  		gw.Altitude,
  		gw.GatewayProfileID,
  	)
  	if err != nil {
  		return handlePSQLError(err, "insert error")
  	}
  
  	for i, board := range gw.Boards {
  		_, err := db.Exec(`
  			insert into gateway_board (
  				id,
  				gateway_id,
  				fpga_id,
  				fine_timestamp_key
  			) values ($1, $2, $3, $4)`,
  			i,
  			gw.GatewayID,
  			board.FPGAID,
  			board.FineTimestampKey,
  		)
  		if err != nil {
  			return handlePSQLError(err, "insert error")
  		}
  	}
  
  	log.WithField("gateway_id", gw.GatewayID).Info("gateway created")
  	return nil
  }
docs: // CreateGateway creates the given gateway.