Spaces:
Paused
Paused
File size: 370 Bytes
3143c25 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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()
|