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.4.tar.gz
(2.5 kB
view details)
Built Distribution
File details
Details for the file sql-format-0.0.4.tar.gz
.
File metadata
- Download URL: sql-format-0.0.4.tar.gz
- Upload date:
- Size: 2.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2112abda2d06c6b6646e080a4024d0f1cf51af53791829668413886548843da4 |
|
MD5 | 188380143ae82f6342b7a0dafa9a8514 |
|
BLAKE2b-256 | 1553eb5b3f1e670694431caa03e80ef38c74ecd98cd41a97b730ed11965d411d |
File details
Details for the file sql_format-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: sql_format-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 998acac20bf728439a14b48a308bb60c753f68e1a7e5c5fd3abf6cf4c5f8c3d8 |
|
MD5 | 7b8520dd73d867d0abbee640745c1cd9 |
|
BLAKE2b-256 | be8299e6989c8f31c84c7a2a6547647b6ce76555126491da0facb3a7451c1c95 |