async def METHOD_NAME(
    app: web.Application,
    *,
    service_key: ServiceKey,
    service_version: ServiceVersion,
) -> ValidService:
    engine: Engine = get_database_engine(app)
    async with engine.acquire() as conn:
        query = sa.select(
            services_meta_data.c.name,
            services_meta_data.c.key,
            services_meta_data.c.thumbnail,
        ).where(
            (services_meta_data.c.key == service_key)
            & (services_meta_data.c.version == service_version)
        )
        result = await conn.execute(query)
        row = await result.fetchone()
        if row is None:
            raise ServiceNotFound(
                service_key=service_key, service_version=service_version
            )
        assert row.key == service_key  # nosec
        query = (
            sa.select(services_consume_filetypes.c.is_guest_allowed)
            .where(
                (services_consume_filetypes.c.service_key == service_key)
                & (services_consume_filetypes.c.is_guest_allowed == True)
            )
            .limit(1)
        )
        is_guest_allowed = await conn.scalar(query)
        thumbnail_or_none = None
        if row.thumbnail is not None:
            with suppress(ValidationError):
                thumbnail_or_none = parse_obj_as(HttpUrl, row.thumbnail)
        return ValidService(
            key=service_key,
            version=service_version,
            is_public=bool(is_guest_allowed),
            title=row.name or service_key.split("/")[-1],
            thumbnail=thumbnail_or_none,
        )