Spaces:
3SCError404
/
Paused

nexus / scratch /debug_db.py
dushyantsingh0
backend stabilization
3143c25
Raw History Blame Contribute Delete
370 Bytes
import sqlite3
conn = sqlite3.connect('nexus.db')
cursor = conn.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables = [r[0] for r in cursor.fetchall()]
print(f"Tables: {tables}")
for t in tables:
cursor = conn.execute(f"PRAGMA table_info({t})")
cols = [c[1] for c in cursor.fetchall()]
print(f"Table {t} columns: {cols}")
conn.close()