sql-formatter-plus
sql-formatter-plus copied to clipboard
feat: Improve SELECT DISTINCT formatting,
Improve SELECT DISTINCT formatting, making it clear that the DISTINCT affects all columns, not just the first one. An example SQL style guide - https://about.gitlab.com/handbook/business-technology/data-team/platform/sql-style-guide/
Unformatted code:
SELECT DISTINCT supplier_name, city FROM suppliers
WHERE supplier_id > 500
ORDER BY supplier_name ASC, city DESC;
Current behavior:
SELECT
DISTINCT supplier_name,
city
FROM
suppliers
WHERE
supplier_id > 500
ORDER BY
supplier_name ASC,
city DESC;
Suggested new behavior:
SELECT DISTINCT
supplier_name,
city
FROM
suppliers
WHERE
supplier_id > 500
ORDER BY
supplier_name ASC,
city DESC;
Notice, that even Github's markdown highlighter works better with the last example, marking SELECT DISTINCT as keywords. In the current behavior the pair DISTINCT supplier_name is shown in gray color.