You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Keyword PRIMARY KEY is not parsed correctly. Instead, KEY, <next identifier> is parsed into a nested TokenList.
To Reproduce
It can be reproduced by executing the following python script:
importsqlparsestatements=sqlparse.parse("""CREATE TABLE foo ( id serial PRIMARY KEY, data text)""")
statements[0].tokens[7]
statements[0].tokens[7].tokensstatements[0].tokens[7].tokens[12]
statements[0].tokens[7].tokens[12].tokens
Expected behavior [<Keyword 'KEY' at 0x104DC88E0>, <Punctuation ',' at 0x104DC8940>, <Newline ' ' at 0x104DC89A0>, <Whitespace ' ' at 0x104DC8A00>, <Keyword 'data' at 0x104DC8A60>] should be flattened into the Parenthesis array, instead of some parts before , and some parts after it become a IdentifierList.
Versions (please complete the following information):
Python: 3.11.5
sqlparse: 0.4.4
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
Keyword
PRIMARY KEY
is not parsed correctly. Instead,KEY, <next identifier>
is parsed into a nestedTokenList
.To Reproduce
It can be reproduced by executing the following python script:
Expected behavior
[<Keyword 'KEY' at 0x104DC88E0>, <Punctuation ',' at 0x104DC8940>, <Newline ' ' at 0x104DC89A0>, <Whitespace ' ' at 0x104DC8A00>, <Keyword 'data' at 0x104DC8A60>]
should be flattened into theParenthesis
array, instead of some parts before,
and some parts after it become aIdentifierList
.Versions (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: