async def update(
        self,
        db: AsyncSession,
        *,
        db_obj: ModelType,
        obj_in: Union[UpdateSchemaType, dict[str, Any]],
        uow: UnitOfWork = None,
    ) -> ModelType:
        """Update an object.

        Args:
        ----
            db (AsyncSession): The database session.
            db_obj (ModelType): The object to update.
            obj_in (Union[UpdateSchemaType, Dict[str, Any]]): The new object data.
            uow (UnitOfWork, optional): Unit of work for transaction control.

        Returns:
        -------
            ModelType: The updated object

        """
        if not isinstance(obj_in, dict):
            obj_in = obj_in.model_dump(exclude_unset=True)

        for key, value in obj_in.items():
            setattr(db_obj, key, value) if hasattr(db_obj, key) else None
        db.add(db_obj)

        if uow is None:
            await db.commit()

        return db_obj
Update an object.

        Args:
        ----
            db (AsyncSession): The database session.
            db_obj (ModelType): The object to update.
            obj_in (Union[UpdateSchemaType, Dict[str, Any]]): The new object data.
            uow (UnitOfWork, optional): Unit of work for transaction control.

        Returns:
        -------
            ModelType: The updated object

        
backend/airweave/crud/_base_system.py