sqlparse icon indicating copy to clipboard operation
sqlparse copied to clipboard

`UNKONWN` instead of `EXISTS` type for EXISTS queries

Open niya3 opened this issue 4 years ago • 0 comments

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

niya3 avatar May 31 '21 09:05 niya3