sql-metadata
sql-metadata copied to clipboard
Table name is altered when it contains a number
Hi, I would like to thank you for this tool, it's awesome!
Although, I found a bug. I left a comment on another issue to understand what the issue is I am facing with.
I found a method/function called .generalize which is cool, but when the table name contains a number like 1, 2..., it is replaced with an 'N' character.
Here is an example:
query_alt = 'select count(1) from dummy_table_1'
Parser(Parser(query_alt).generalize).tables
The result is:
['dummy_table_N']
Could you please take a look at it?
Thank you!
I think that's the point of .generalize:
generalize : str (property)
Removes most variables from an SQL query and replaces them with X or N for numbers.
Based on Mediawiki's DatabaseBase::generalizeSQL