sql-formatter
sql-formatter copied to clipboard
Named placeholders are broken due to whitespace
Name placeholders like WHERE name = :name
are broken and do not replace at all.
Example:
SELECT supplier_name, city FROM suppliers
WHERE supplier_id = :name
this formats as:
SELECT
supplier_name,
city
FROM
suppliers
WHERE
supplier_id =: name
Notice the =:
and the space between the :
and name
- =: name
You can see this right on the demo page:
https://www.vertical-blank.com/sql-formatter/
Note that positional placeholders are still formatted and replace correctly.