sql-metadata
sql-metadata copied to clipboard
Issue with tables extraction
Hi, When table names comes after a comment, the parser is ignoring the first table name from the output. Example :
D = """ Select c1 from --Comment-- d1,d2,d3;""" Parser(D).tables ['d2' , 'd3']
Note: If I remove the comment then the Parser is able to provide the correct output . I.e., ['d1', 'd2' , 'd3']
For inline comments you don't need the ending --
which indicates another comment.
I think we stopped removing new lines markers so would expect this to come from sqlparse
.
Even if you just have -- in the inline comment, there is no change in the output. The output will be the same for /* comment */ as well.