Closed Maya-BF closed 7 years ago
Hi,
Trying to access the list of tables as in the example in the read.me,
`import psqlparse statements = psqlparse.parse('SELECT * from mytable') used_tables = statements[0].tables() # ['my_table']
I get an error:
Attribute error: 'Statement' object has no attribute 'tables'.
Also dir(statements[0]) gives: ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_obj', 'from_clause', 'target_list', 'type', 'where_clause', 'with_clause']
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_obj', 'from_clause', 'target_list', 'type', 'where_clause', 'with_clause']
Did you install from pip (in that case, which version) or did you use master branch?
Installed from pip version 0.2.5
tables is only supported in 1.0 release candidates.
tables
Hi,
Trying to access the list of tables as in the example in the read.me,
`import psqlparse statements = psqlparse.parse('SELECT * from mytable') used_tables = statements[0].tables() # ['my_table']
I get an error:
Attribute error: 'Statement' object has no attribute 'tables'.
Also dir(statements[0]) gives:
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_obj', 'from_clause', 'target_list', 'type', 'where_clause', 'with_clause']