Skip to main content

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


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.15.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

sqlton-0.1.15-py3-none-any.whl (14.0 kB view hashes)

Uploaded Python 3

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