Open stenci opened 4 months ago
The following two sql commands should be equivalent, but the missing space in the second case causes it not to recognize the select.
I am starting now to use sqlparse, so please let me know if this is not a bug and I am setting my expectations wrong.
sqlparse
tokens = sqlparse.parse('select (select 1)')[0] for n, t in enumerate(tokens): print(n, t.ttype, t) # Output: # 0 Token.Keyword.DML select # 1 Token.Text.Whitespace # 2 None (select 1)
tokens = sqlparse.parse('select(select 1)')[0] for n, t in enumerate(tokens): print(n, t.ttype, t) # Output: # 0 None select(select 1)
This is exactly the side effect mentioned here: https://github.com/andialbrecht/sqlparse/blob/master/sqlparse/keywords.py#L56
Fixing this isn't straight forward since it needs some refactoring in the lexer.
The following two sql commands should be equivalent, but the missing space in the second case causes it not to recognize the select.
I am starting now to use
sqlparse
, so please let me know if this is not a bug and I am setting my expectations wrong.