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.1.0.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file sql-format-0.1.0.tar.gz
.
File metadata
- Download URL: sql-format-0.1.0.tar.gz
- Upload date:
- Size: 2.4 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 | 0009fab0aa403b5766e3f6db10a0cdd2f624e21add0fe7125c86730d888c8ee8 |
|
MD5 | 523b87435582e0dee7271113d9b1177c |
|
BLAKE2b-256 | 3a147682c9bd512e38c937b9e8b0662e84649ef0142f8b0d0c44a9679cfd2100 |
File details
Details for the file sql_format-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: sql_format-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 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 | 289a57bfe42fa18ebe03f901a1215e39dd266403f7cbb32b85b446d3bb761e11 |
|
MD5 | 3be217bf341e1c5d47a38f8d5ed91b02 |
|
BLAKE2b-256 | 56044f97223e41a58498729cd8cdef41c56b8da3869851900f58c0c32922ace8 |