async def upsert_file(
        self,
        document_id: UUID,
        file_name: str,
        file_oid: int,
        file_size: int,
        file_type: Optional[str] = None,
    ) -> None:
        """Add or update a file entry in storage."""
        query = f"""
        INSERT INTO {self._get_table_name(self.table_name)}
        (document_id, name, oid, size, type)
        VALUES ($1, $2, $3, $4, $5)
        ON CONFLICT (document_id) DO UPDATE SET
            name = EXCLUDED.name,
            oid = EXCLUDED.oid,
            size = EXCLUDED.size,
            type = EXCLUDED.type,
            updated_at = NOW();
        """
        await self.connection_manager.execute_query(
            query, [document_id, file_name, file_oid, file_size, file_type]
        )
Add or update a file entry in storage.
py/core/providers/file/postgres.py