https://github.com/cockroachdb/sqlfmt
SQL formatter with width-aware output
https://github.com/cockroachdb/sqlfmt
Last synced: 5 months ago
JSON representation
SQL formatter with width-aware output
- Host: GitHub
- URL: https://github.com/cockroachdb/sqlfmt
- Owner: cockroachdb
- License: apache-2.0
- Fork: true (madelynnblue/sqlfmt)
- Created: 2020-08-25T16:56:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T19:45:52.000Z (over 3 years ago)
- Last Synced: 2025-10-31T23:12:21.809Z (8 months ago)
- Language: Go
- Homepage: https://sqlfum.pt/
- Size: 115 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sqlfmt
Experimental SQL formatter with width-aware output
Based on http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf.
Requires having the master branch of https://github.com/cockroachdb/cockroach checked out at `$GOPATH/src/github.com/cockroachdb/cockroach`, and running `make` in that directory.
# Deployment
To deploy:
1. Ensure your kubectl creds for the desired cluster are present.
* See https://github.com/cockroachlabs/h2hello
2. Run `./build.sh`
3. If everything went well, kill current pods so they will be redeployed from the new docker image:
`kubectl get po | grep sqlfmt | awk '{print $1}' | xargs kubectl delete pod`
* Note that this will work only if your branch is the same branch used by
the service. You can use the below command to set the image:
* `kubectl set image deployment/sqlfmt sqlfmt=gcr.io/cockroach-dev-inf/cockroachlabs/sqlfmt:master`
Note that step 8 will only work if you're on the master branch.