Skip to main content

sqlglot-cli

CLI wrapper around sqlglot.

Installation

pipx install sqlglot-cli

# or with sqlglotrs
pipx install 'sqlglot-cli[rs]'

# or with rich terminal
pipx install 'sqlglot-cli[rich]'

# or with both
pipx install 'sqlglot-cli[rs,rich]'

Usage

# read from file
sqlglot-cli transpile foo.sql --read postgres --write clickhouse --pretty

# or use stdin
cat foo.sql | sqlglot-cli transpile - --read postgres --write clickhouse --pretty

# pipe to your heart's desire to incorporate into workflows
cat examples/postgres__ctes.in.sql |
sqlglot-cli optimize - -d postgres --all |
sqlglot-cli transpile - -r postgres -w snowflake |
sqlglot-cli optimize - -d snowflake --all |
sqlfluff fix - --dialect snowflake

Metadata

Release files for sqlglot-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlglot-cli 0.1.0
File Size Uploaded
sqlglot_cli-0.1.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlglot-cli 0.1.0
File Interpreter ABI Platform
sqlglot_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / sqlglot_cli-0.1.0.tar.gz

Download URL sqlglot_cli-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
14523d6102d131d2efaed36a615842bd6948ecbffa5c3de1f98019407614ca0a
BLAKE2b-256 checksum
How to use checksums
63addc2e868dddc3ef7f0c9d5874c52e8c38bf378336859c0a813ac377afbf74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Darwin/23.5.0

Release files / sqlglot_cli-0.1.0-py3-none-any.whl

Download URL sqlglot_cli-0.1.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96b3c537aa96bc4f6c570ac3e1f90fa231333f92afc68743bdd0620e5bf5cc6f
BLAKE2b-256 checksum
How to use checksums
f9a3f57dc7f6f639c594eb460bd55018d1d523a84bb59dec4b83012c9f88a82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.7 Darwin/23.5.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page