import sqlite3
con = sqlite3.connect(r'file:C:\Users\minhg\.local\share\opencode\opencode.db?mode=ro', uri=True)
cur = con.cursor()
tables = [r[0] for r in cur.execute("select name from sqlite_master where type='table'")]
print(tables)
for t in tables:
    if any(k in t.lower() for k in ('service', 'config', 'setting', 'server', 'auth')):
        print('---', t)
        cols = [c[1] for c in cur.execute(f'pragma table_info({t})')]
        print(cols)
        for row in cur.execute(f'select * from {t} limit 5'):
            print(str(row)[:200])
