    async def remove_service(self, service: Service, orm_service: orm.Service) -> None:
        """Remove a service and all related objects from the database.

        Args:
            service (Service): the service object to be removed

            orm_service (orm.Service): The `orm.Service` object linked
            with `service`
        """
        if service.managed:
            await service.stop()

        if service.oauth_client:
            self.oauth_provider.remove_client(service.oauth_client_id)

        if orm_service._server_id is not None:
            orm_server = (
                self.db.query(orm.Server).filter_by(id=orm_service._server_id).first()
            )
            if orm_server is not None:
                self.db.delete(orm_server)

        if service.oauth_no_confirm:
            oauth_no_confirm_list = self.settings.get('oauth_no_confirm_list')
            oauth_no_confirm_list.discard(service.oauth_client_id)

        self.db.delete(orm_service)
        self.db.commit()
Remove a service and all related objects from the database.

Args:
service (Service): the service object to be removed

orm_service (orm.Service): The `orm.Service` object linked
with `service`
jupyterhub/apihandlers/services.py