SQLAlchemy - Getting a list of tables

前端 未结 9 1164
青春惊慌失措
青春惊慌失措 2020-12-08 03:40

I couldn\'t find any information about this in the documentation, but how can I get a list of tables created in SQLAlchemy?

I used the class method to create the tab

9条回答
  •  既然无缘
    2020-12-08 04:05

    from sqlalchemy import create_engine
    engine = create_engine('postgresql://use:pass@localhost/DBname')
    print (engine.table_names())
    

提交回复
热议问题