Crates.io | sqlify |
lib.rs | sqlify |
version | 0.1.1 |
source | src |
created_at | 2023-07-10 10:49:41.413382 |
updated_at | 2023-07-10 10:52:55.861163 |
description | A simple CLI tool for formatting SQL queries. |
homepage | https://github.com/petarvujovic/sqlify |
repository | https://github.com/petarvujovic/sqlify |
max_upload_size | |
id | 912847 |
size | 25,454 |
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 sqlify
To 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.sql
where query.sql
looks like
SELECT * FROM tablename
to get the following output:
SELECT
*
FROM
tablename
There are fomrating options from sqlformat exposed through arguments:
-u
or --uppercase
to denote the use of uppercase keywords-t
or --tabs
to denote the use of tabs-i
or --indent
to specify the number of spaces to use for indentation
(defaults to 2), ignored if tabs are used-l
or --lines-between-queries
to specify the number of line breaks
to use between queries (defaults to 1)