async def _attach_sync_schedule_info(
        self, db: AsyncSession, source_connections: List[SourceConnection]
    ) -> List[SourceConnection]:
        """Attach sync schedule information to source connections.

        Args:
            db: The database session
            source_connections: List of source connections to augment

        Returns:
            The source connections with attached schedule info
        """
        if not source_connections:
            return []

        # Get all sync IDs
        sync_ids = [sc.sync_id for sc in source_connections if sc.sync_id]
        if not sync_ids:
            return source_connections

        # Get all syncs for these IDs in a single query
        from airweave.models.sync import Sync

        query = select(Sync.id, Sync.cron_schedule, Sync.next_scheduled_run).where(
            Sync.id.in_(sync_ids)
        )
        result = await db.execute(query)
        sync_schedules = {
            row.id: {
                "cron_schedule": row.cron_schedule,
                "next_scheduled_run": row.next_scheduled_run,
            }
            for row in result.fetchall()
        }

        # Attach schedule info to each source connection
        for sc in source_connections:
            if sc.sync_id and sc.sync_id in sync_schedules:
                schedule_info = sync_schedules[sc.sync_id]
                sc.cron_schedule = schedule_info["cron_schedule"]
                sc.next_scheduled_run = schedule_info["next_scheduled_run"]

        return source_connections
Attach sync schedule information to source connections.

        Args:
            db: The database session
            source_connections: List of source connections to augment

        Returns:
            The source connections with attached schedule info
        
backend/airweave/crud/crud_source_connection.py