async def get_by_sync_id(
        self, db: AsyncSession, *, sync_id: UUID, current_user: User
    ) -> Optional[SourceConnection]:
        """Get a source connection by sync ID.

        Args:
            db: The database session
            sync_id: The ID of the sync
            current_user: The current user

        Returns:
            The source connection for the sync
        """
        query = select(self.model).where(
            self.model.sync_id == sync_id,
            self.model.organization_id == current_user.organization_id,
        )
        result = await db.execute(query)
        source_connection = result.scalar_one_or_none()

        if source_connection:
            # Attach latest sync job info and compute status
            source_connection = (await self._attach_latest_sync_job_info(db, [source_connection]))[
                0
            ]
            # Also attach schedule info
            source_connection = (await self._attach_sync_schedule_info(db, [source_connection]))[0]

        return source_connection
Get a source connection by sync ID.

        Args:
            db: The database session
            sync_id: The ID of the sync
            current_user: The current user

        Returns:
            The source connection for the sync
        
backend/airweave/crud/crud_source_connection.py