viewer: Switch over to SQLAlchemy