sqlparse
sqlparse copied to clipboard
`UNKONWN` instead of `EXISTS` type for EXISTS queries
sqlparse doesn't get queries with EXISTS on the first position quite well. This is valid syntax for, e.g., Clickhouse: https://clickhouse.tech/docs/en/sql-reference/statements/exists/
This is the reason for bug https://github.com/maximdanilchenko/aiochclient/issues/50 , because code expedts for EXISTS type to be returned.
Preparation
$ pip install sqlparse==0.4.1
from sqlparse import parse
res = parse("EXISTS TABLE sometalbe")[0]
print(res.get_type())
Expected result
EXISTS
Current resutl
UNKNOWN