Files
MoFin/archive/20260722-scripts-cleanup/check_stocks_table.py
T

9 lines
345 B
Python

import sqlite3
c = sqlite3.connect('/home/hmo/MoFin/data/mofin.db')
sql = c.execute("SELECT sql FROM sqlite_master WHERE name='stocks'").fetchone()
print(sql[0] if sql else 'no stocks table')
print()
cnt = c.execute("SELECT COUNT(*) FROM stocks").fetchone()[0]
print('rows:', cnt)
for r in c.execute("SELECT * FROM stocks LIMIT 3"):
print(r)