SELECT
  d.id, d.name, d.operator, d.capacity_mw, d.status, d.year_opened,
  d.region_id,
  ST_AsGeoJSON(d.location)::TEXT as location_geojson,
  r.code as region_code,
  r.name as region_name
FROM datacenters d
JOIN grid_regions r ON d.region_id = r.id
ORDER BY d.capacity_mw DESC
