async def delete_connection(
        self, db: AsyncSession, connection_id: UUID, user: schemas.User
    ) -> schemas.Connection:
        """Delete a connection and its integration credential.

        Args:
            db: The database session
            connection_id: The ID of the connection to delete
            user: The current user

        Returns:
            The deleted connection

        Raises:
            NotFoundException: If the connection is not found
        """
        async with UnitOfWork(db) as uow:
            # Get connection
            connection = await crud.connection.get(uow.session, id=connection_id, current_user=user)
            if not connection:
                raise NotFoundException(f"No active connection found for '{connection_id}'")

            # Remove all syncs for this connection
            await crud.sync.remove_all_for_connection(
                uow.session, connection_id, current_user=user, uow=uow
            )

            # Delete the connection
            connection = await crud.connection.remove(
                uow.session, id=connection_id, current_user=user, uow=uow
            )

            # Delete the integration credential if it exists
            if connection.integration_credential_id:
                await crud.integration_credential.remove(
                    uow.session, id=connection.integration_credential_id, current_user=user, uow=uow
                )

            await uow.commit()
            return connection
Delete a connection and its integration credential.

        Args:
            db: The database session
            connection_id: The ID of the connection to delete
            user: The current user

        Returns:
            The deleted connection

        Raises:
            NotFoundException: If the connection is not found
        
backend/airweave/core/connection_service.py