Skip to content

Instantly share code, notes, and snippets.

@herejia
Last active March 18, 2016 15:21
Show Gist options
  • Save herejia/ffe2ee5d6b0c946223b6 to your computer and use it in GitHub Desktop.
Save herejia/ffe2ee5d6b0c946223b6 to your computer and use it in GitHub Desktop.
#!/bin/sh
# sudo pip install sqlparse
# sudo apt-get install xclip
echo "$1" | tr -s [:blank:] > /tmp/sqlfmt.in
sqlformat --reindent --keywords upper --identifiers lower /tmp/sqlfmt.in | xclip -selection c
@herejia
Copy link
Author

herejia commented Mar 18, 2016

sqlfmt.sh 'select columna, columnb fRoM table_Name' copies in the clipboard :

SELECT columna,
       columnb
FROM TABLE_NAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment