Spaces:
Running
Running
| import sqlite3 | |
| import os | |
| db_paths = [ | |
| "senti_db.sqlite", | |
| os.path.join("senti", "senti_db.sqlite") | |
| ] | |
| for path in db_paths: | |
| print(f"=== Database: {path} ===") | |
| if not os.path.exists(path): | |
| print(" Does not exist!") | |
| continue | |
| try: | |
| conn = sqlite3.connect(path) | |
| cursor = conn.cursor() | |
| cursor.execute("SELECT name FROM sqlite_master WHERE type='table'") | |
| tables = [t[0] for t in cursor.fetchall()] | |
| print(f" Tables: {tables}") | |
| conn.close() | |
| except Exception as e: | |
| print(f" Error: {e}") | |