Spaces:
Running
Running
| import sqlite3 | |
| db_path = "soma_sessions.db" | |
| try: | |
| conn = sqlite3.connect(db_path) | |
| cursor = conn.cursor() | |
| cursor.execute("SELECT name FROM sqlite_master WHERE type='table';") | |
| tables = cursor.fetchall() | |
| print(f"Tables: {tables}") | |
| for table in tables: | |
| table_name = table[0] | |
| cursor.execute(f"SELECT COUNT(*) FROM {table_name}") | |
| count = cursor.fetchone()[0] | |
| print(f"Table {table_name} has {count} rows") | |
| conn.close() | |
| except Exception as e: | |
| print(f"Error: {e}") | |