sqlparse
sqlparse copied to clipboard
Several issues with DDL parsing - most annoying is table name identified as a function
'create table A(....'
will identify A as a function
'CREATE table A(....'
will not - aka is OK
'create table "A"(....'
is also OK
varchar2 (2)
will identify varchar2 as Token.Name.Builtin while
varchar2(2)
will identify varchar2 as Token.Name
I know the original intention with this library probably was not parsing DDL's, but I bet there is more persons trying to parse DDL's than SQL (queries)
@rvatne if it is a still actual for you - I created separate library for DDL parsing because of several issues in sqlparse https://github.com/xnuinside/simple-ddl-parser
I got bitten by this today. I had to capitalize both "create" and "table". It's really surprising to me that parsing is so affected by case.