From 87ed83210336260892ea7540ec89a39ade81e1ec Mon Sep 17 00:00:00 2001 From: Ethan Date: Sun, 24 Mar 2024 20:46:56 +1100 Subject: [PATCH] Add support for sqlfmt for dbt https://docs.sqlfmt.com/ --- sqlformat.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sqlformat.el b/sqlformat.el index 5fc90ea..d2256f4 100644 --- a/sqlformat.el +++ b/sqlformat.el @@ -70,6 +70,7 @@ This command should receive SQL input via STDIN and output the reformatted SQL to STDOUT, returning an appropriate exit code." :type '(choice (const :tag "Use \"sqlformat\"" sqlformat) + (const :tag "Use \"sqlfmt\"" sqlfmt) (const :tag "Use \"pgformatter\"" pgformatter) (const :tag "Use \"sqlfluff\"" sqlfluff) (const :tag "Use \"sql-formatter\"" sql-formatter))) @@ -88,11 +89,13 @@ For example, these args may be useful for sqlformat: (\"-k\" \"upper\")" (reformatter-define sqlformat :program (pcase sqlformat-command (`sqlformat "sqlformat") + (`sqlfmt "sqlfmt") (`pgformatter "pg_format") (`sqlfluff "sqlfluff") (`sql-formatter "sql-formatter")) :args (pcase sqlformat-command (`sqlformat (append sqlformat-args '("-r" "-"))) + (`sqlfmt (append sqlformat-args '("-"))) (`pgformatter (append sqlformat-args '("-"))) (`sqlfluff (append '("format") sqlformat-args '("-"))) (`sql-formatter sqlformat-args))