# -*- coding: utf-8 -*- import sqlite3 from app.config import settings conn = sqlite3.connect(str(settings.sqlite_path)) conn.row_factory = sqlite3.Row r = conn.execute( "select room_id, last_anchor, avatar_url from rooms where room_id='120371233716'" ).fetchone() print("room", dict(r) if r else None) p = conn.execute( "select room_id, title, substr(cover_url,1,120) c from yt_assign_pool_urls where room_id='120371233716'" ).fetchall() print("pool", [dict(x) for x in p])