ZetaSQL Formatter
This repository is forked from google/zetasql and provides SQL formatter with preserved comments. This formatter can be applied to mainly BigQuery and SpanSQL.
# To install by pre-commit
pip intall pre-commit
# Copy template .pre-commit-config.yaml to your project.
cp .pre-commit-config.yaml ./path/to/your/project
cd ./path/to/your/project && pre-commit install
# To install for MacOSX
wget https://github.com/Matts966/zetasql-formatter/releases/latest/download/zetasql-formatter_darwin_amd64.zip \
&& sudo unzip zetasql-formatter_darwin_amd64.zip -d /usr/local/bin
# To install for Linux
wget https://github.com/Matts966/zetasql-formatter/releases/latest/download/zetasql-formatter_linux_x86_64.zip \
&& sudo unzip zetasql-formatter_linux_x86_64.zip -d /usr/local/bin
# To apply formatter
zetasql-formatter [paths]
# To apply formatter using Docker
docker run -it --rm -v `pwd`:/home:Z matts966/zetasql-formatter:latest [paths]
# To build (with heavy work load in disk, memory and CPU)
make build
License
Sponsors
The development of this formatter is sponsored by the Japan Data Science Consortium.