A simple SQL Formatter that supports Doma Framework.
- Marketplace
- Repository
- Formatter forked from zeroturnaround/sql-formatter
Files can be formatted by the Format Document (or Format Document With... and then select Doma SQL Formatter) option or keyboard shortcuts.
Default keyboard shortcuts:
- MacOS: ⇧⌥F or Shift+Option+F
- Windows: Shift+Alt+F
- Linux: Ctrl+Shift+I
You can choose Doma SQL Formatter: Force Format
to force format as SQL.
- Standard SQL
- MariaDB
- MySQL
- PostgreSQL
- DB2
- PL/SQL
- N1QL
- Redshift
- Spark
- TSQL
Original file:
SELECT * FROM employee
WHERE /*%for name : names */
employee_name LIKE /* name */'hoge'
/*%if name_has_next */
/*# "or" */
/*%elseif condition */
/*# hogehoge */
/*%end */
/*%end*/
OR salary > 1000
Will be formatted like:
SELECT
*
FROM
employee
WHERE
/*%for name : names */
employee_name LIKE /* name */'hoge'
/*%if name_has_next */
/*# "or" */
/*%elseif condition */
/*# hogehoge */
/*%end */
/*%end*/
OR salary > 1000