import db def get_action(slug, action_id): conn = db.connect(slug) row = conn.execute("SELECT * FROM _actions WHERE id = ?", (action_id,)).fetchone() conn.close() return dict(row) if row else None