Files
diary-family/verify_db.py

11 lines
508 B
Python
Raw Normal View History

import sqlite3
conn = sqlite3.connect('db.sqlite3')
cursor = conn.cursor()
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name LIKE 'core_%' ORDER BY name;")
print("Tables:", [r[0] for r in cursor.fetchall()])
cursor.execute("SELECT COUNT(*) FROM core_familymember;")
print("Family members count:", cursor.fetchone()[0])
cursor.execute("SELECT sql FROM sqlite_master WHERE type='table' AND name='core_insightrecord';")
print("InsightRecord schema:", cursor.fetchone()[0])
conn.close()