Parse SQL statement into straight forward Syntax Tree.
Project description
SQLTOn
SQLTOn parse sql statements (according to Sqlite3 gramar description) into a easily browseable/processable tree.
from sqlton import parse
from sqlton.ast import Select
statement = parse('select Something from SomeTable whern SomethingElse=SomeValue')
if not isinstance(statement, Select):
print('only select statement are accepted')
exit()
if not hasattr(statement, 'limit'):
print('select statement shall have a limit clause !')
exit()
def compute(expression):
...
if compute(statement.limit[0]) > 100:
print('too much entry requested !')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sqlton-0.1.19.tar.gz
(11.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
sqlton-0.1.19-py3-none-any.whl
(14.7 kB
view details)
File details
Details for the file sqlton-0.1.19.tar.gz.
File metadata
- Download URL: sqlton-0.1.19.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.6-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba207042e88443ff74bccf91540cad8dbd28cc0eca9260c56d0f3842e64ad974
|
|
| MD5 |
39e31baf6642a7d4b52a7772a62fbedb
|
|
| BLAKE2b-256 |
b03ba75ce00ab849d60e2f39915b0604b9ae46316dcb84382d07cd4f2c4278da
|
File details
Details for the file sqlton-0.1.19-py3-none-any.whl.
File metadata
- Download URL: sqlton-0.1.19-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.6-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee7911cd6b339bdd20506a3454e3599503384f1107c5eb9769cd24c4bf1bebbb
|
|
| MD5 |
5bd7e2b3020c202847b8ada9c3132c42
|
|
| BLAKE2b-256 |
e3b585ba5a5298e80b6324d03fbd1056b9d06e359886add5b84ef44aa8718395
|