A CLI tool to format your SQL code.
This tool utilizes sqlformat under the hood to format the given SQL code.
To install sqlify simply run the cargo install command:
cargo install sqlifyTo use it simply pass in your SQL as the argument, or pipe it from a file, like this:
sqlify "SELECT * FROM tablename"
# or
cat query.sql | sqlify
# or
sqlify < query.sqlwhere query.sql looks like
SELECT * FROM tablenameto get the following output:
SELECT
*
FROM
tablenameThere are fomrating options from sqlformat exposed through arguments:
-uor--uppercaseto denote the use of uppercase keywords-tor--tabsto denote the use of tabs-ior--indentto specify the number of spaces to use for indentation (defaults to 2), ignored if tabs are used-lor--lines-between-queriesto specify the number of line breaks to use between queries (defaults to 1)