# sqlfmt **Repository Path**: kevin1898/sqlfmt ## Basic Information - **Project Name**: sqlfmt - **Description**: No description available - **Primary Language**: Go - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-22 - **Last Updated**: 2021-06-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # sqlfmt ## Installation ```sh $ go get github.com/jackc/sqlfmt/... $ which sqlfmt $GOPATH/bin/sqlfmt ``` ## Usage - You can either: + Provide the path to one or more SQL files as command line arguments: ```sh $ sqlfmt testdata/select_where.input.sql select foo, bar from baz where foo > 5 and bar < 2 ``` + Or, directly provide the SQL string via stdin: ```sh $ echo "select * from users" | sqlfmt select * from users ``` ```sh $ sqlfmt < testdata/like.input.sql select foo, bar from baz where foo like 'abd%' or foo like 'ada%' escape '!' or foo not like 'abd%' or foo not like 'ada%' escape '!' or foo ilike 'efg%' or foo ilike 'ada%' escape '!' or foo not ilike 'efg%' or foo not ilike 'ada%' escape '!' ``` - View [testdata](./testdata) for more examples.