yun-cn / zetasql-formatter

ZetaSQL Formatter with preserved comments mainly for BigQuery and SpanSQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZetaSQL Formatter

release test

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

Apache License 2.0

Sponsors

The development of this formatter is sponsored by the Japan Data Science Consortium.

About

ZetaSQL Formatter with preserved comments mainly for BigQuery and SpanSQL

License:Apache License 2.0


Languages

Language:C++ 86.9%Language:Java 6.8%Language:Starlark 2.4%Language:Yacc 1.8%Language:Python 1.8%Language:Lex 0.3%Language:C 0.0%Language:Dockerfile 0.0%Language:Makefile 0.0%Language:Shell 0.0%