Skip to content

A CLI tool to format your SQL code.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

petarvujovic98/sqlify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqlify

A CLI tool to format your SQL code.

Features

This tool utilizes sqlformat under the hood to format the given SQL code.

Installation

To install sqlify simply run the cargo install command:

cargo install sqlify

Usage

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)

About

A CLI tool to format your SQL code.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages