How do I list a DB’s tables with Python’s DB API?
Failing that, is there another way to do it?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The DBAPI does not have a function for this so unfortunately you need to use SQL that is specific to the database engine (there is no standardized way to list tables).
SHOW TABLESSELECT tablename FROM pg_tables WHERE schemaname = 'public'SELECT name FROM sqlite_master WHERE type = 'table'SELECT Distinct TABLE_NAME FROM information_schema.TABLESSELECT table_name FROM all_tablesSELECT table_name FROM tables