import sqlite3, json, uuid, datetime

db = sqlite3.connect("/opt/friend-cluster/data/friend-cluster-v1.db")
db.row_factory = sqlite3.Row

# 查看快照表结构
cols = [d[1] for d in db.execute("PRAGMA table_info(config_snapshots)").fetchall()]
print("columns:", cols)

row = db.execute("SELECT * FROM config_snapshots WHERE id='snap-166ad3e9-7e6'").fetchone()
if not row:
    print("SOURCE SNAPSHOT NOT FOUND")
    raise SystemExit(1)
d = dict(row)
for k, v in d.items():
    s = str(v)
    print(f"{k}: {s[:100]}{'...' if len(s) > 100 else ''}")
