TablePlus / Toolkit

TablePlus Toolkit
https://tableplus.com
10 stars 0 forks source link

SQL Formatter: comma-first option? #2

Open edbrannin opened 4 years ago

edbrannin commented 4 years ago
  1. Which app are you using (JSON, XML, SQL):

SQL

  1. The steps to reproduce this issue:

Format the default SQL (maybe with more columns):

SELECT
    COUNT(price),
    price,
    something_else,
    more_columns
FROM
    orders
WHERE
    price < 70
GROUP BY
    price
,   something_else
,   more_columns
ORDER BY
    price

Desired result:

SELECT
    COUNT(price)
,   price
,   something_else
,   more_columns
FROM
    orders
WHERE
    price < 70
GROUP BY
    price
,   something_else
,   more_columns
ORDER BY
    price

Why? I like it because commenting out (non-first) columns gets a lot easier.

SELECT
    COUNT(price)
,   price
--, something_else
--, more_columns
FROM
    orders
WHERE
    price < 70
GROUP BY
    price
--, something_else
--, more_columns
ORDER BY
    price
thien-do commented 4 years ago

Thank you! This would be useful. We will support this :+1: