Skip to main content

Format your SQL statements using the sql-pretty-printer API

Project description

sql-format

Format your SQL statements using the sql-pretty-printer API.

Dependencies

This project uses the following modules:

Installation

To install, download the repository via:

git clone https://github.com/rrickgauer/sql-format.git

Usage

In the sql-format directory, use:

python sql-format.py

Example

sql-format will take the following SQL statement:

select Songs.id, Songs.title, Artists.name from Songs left join Artists on Songs.artist_id = Artists.id where Songs.id > 100 order by Songs.title desc limit 20;

and turns it into this:

SELECT Songs.id,
       Songs.title,
       Artists.name
FROM   Songs
       LEFT JOIN Artists
              ON Songs.artist_id = Artists.id
WHERE  Songs.id > 100
ORDER  BY Songs.title DESC
LIMIT  20;

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sql-format-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

sql_format-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file sql-format-0.0.1.tar.gz.

File metadata

  • Download URL: sql-format-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

File hashes

Hashes for sql-format-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8c2f1880c814363a3bfb4c3487e7f35fecd0155660db5e3bd746a7003fe1aff0
MD5 161b28c13690cb422c1d99922c8d12d4
BLAKE2b-256 eb2e834a19b4bfb28961994553a8a380fa9880c7172416ed8b176a68de7b35de

See more details on using hashes here.

File details

Details for the file sql_format-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sql_format-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

File hashes

Hashes for sql_format-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aaba1c0cf4ccc9b52c0d577d2aa5dd30dfd6d263ee2963726f3425b563c98097
MD5 e9c980bcc1cf15e58658defa81cf50e1
BLAKE2b-256 d7a2675ab90f25e5bc59094dcab8d2c44f11be79375b2ff72dd053660a9fa6b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page