David-Wobrock / sqlvalidator

SQL queries formatting, syntactic and semantic validation

Home Page:https://pypi.org/project/sqlvalidator/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Isnot valid cases

satels opened this issue · comments

>>> import sqlvalidator
>>> sql_query = sqlvalidator.parse("is_hidden is True and (is_active is True or is_zs is True)")
>>> sql_query.is_valid()
False
>>> sql_query.errors
['']
>>> sql_query = sqlvalidator.parse("select * from b where is_hidden is True and (is_active is True or is_zs is True)")
>>> sql_query.is_valid()
True
>>> sql_query.errors
[]
>>> sql_query = sqlvalidator.parse("select * from b where is_hidden is True and (is_active is True or is_zs is True)r-")
>>> sql_query.is_valid()
True
>>> sql_query.errors
[]
>>> sql_query = sqlvalidator.parse("select * from b where is_hidden is True and (is_active is True or is_zs is True)r-33fds/")
>>> sql_query.errors
[]
>>> sql_query.is_valid()
True