Files

9 lines
422 B
Python

import sqlite3
conn = sqlite3.connect('/home/hmo/MoFin/data/mofin.db')
for t in ('mtf_cache', 'macro_context_log', 'live_prices', 'price_events', 'market_snapshots'):
try:
cols = [c[1] for c in conn.execute(f"PRAGMA table_info({t})")]
cnt = conn.execute(f"SELECT COUNT(*) FROM {t}").fetchone()[0]
print(f"{t}: rows={cnt} cols={cols}")
except Exception as e:
print(f"{t}: ERROR {e}")