I plan to add ability to launch language server or format given input to this CLI
My Language Server for T-SQL. Thinking about making this work for possibly SSMS but also trying to make it work for Neovim
Parses T-SQL queries and places them into abstract syntax to make it easier for other crates make sense of the queries that are given to it
Formats T-SQL queries into a standardized readable format. Settings are inspired by Poor Man's TSQL Formatter. Right now this is a CLI where you pass options and pass the input and it outputs result query into stdout. Errors are returned in stderr.
formatter -k upper -b -i 'select top 50 percent LastPrice, HighPrice, LowPrice, QuoteTime from Market mt where QuoteTime > '\''6:30'\'' and PercentChange > 0 oRDer By Symbol'
SELECT TOP 50 PERCENT LastPrice
,HighPrice
,LowPrice
,QuoteTime
FROM Market mt
WHERE QuoteTime > '6:30'
AND PercentChange > 0
ORDER BY Symbol
Usage: formatter [OPTIONS] <INPUT>
Arguments:
<INPUT>
Options:
-c, --indent-comma-lists <INDENT_COMMA_LISTS>
[possible values: trailing-comma, space-after-comma]
-i, --indent-in-lists
-b, --indent-between-conditions
-k, --keyword-case <KEYWORD_CASE>
[default: upper] [possible values: upper, lower]
-m, --max-width <MAX_WIDTH>
[default: 80]
-w, --indent-width <INDENT_WIDTH>
[default: 4]
-u, --use-tab
-h, --help
Print help
-V, --version
Print version
-
Select Queries
- [ ALL | DISTINCT ]
- TOP (expression) [ PERCENT ] | [ WITH TIES ]
- select items
- with subqueries
- with numbers
- with identifiers
- with aliases
- with aggregate functions
- from clause
- basic table
- table with alias
- table valued function
- pivot table
- unpivot table
- joins
- where clause
- with subqueries
- with numbers
- with identifiers
- with aggregate functions
- group by clause
- with numbers
- with identifiers
- with aggregate functions
- having clause
- with subqueries
- with numbers
- with identifiers
- with aggregate functions
- order by clause
- with numbers
- with identifiers
-
CTEs
-
Insert Queries
-
Bulk Insert Queries
-
Delete Queries
-
Update Queries
-
Unions