When using aliases in a Postgres SQL query, you need to use double quotes in your query.
$sql = '
SELECT facility.facility_id AS "facilityId"
FROM facility
';
When using strings (for example to build JSON objects), you need to use single quotes in your query.
$sql = "