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.17.tar.gz
(11.5 kB
view hashes)
Built Distribution
sqlton-0.1.17-py3-none-any.whl
(14.7 kB
view hashes)