async def async_add_message(self, key: str, message: ChatMessage) -> None:
        """Async version of Add a message for a key."""
        async with self._async_session() as session:
            stmt = text(
                f"""
                INSERT INTO {self.schema_name}.{self._table_class.__tablename__} (key, value)
                VALUES (:key, :value)
                ON CONFLICT (key)
                DO UPDATE SET
                    value = array_cat({self._table_class.__tablename__}.value, :value);
                """
            )
            params = {"key": key, "value": [message.model_dump_json()]}
            await session.execute(stmt, params)
            await session.commit()
Async version of Add a message for a key.
llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-postgres/llama_index/storage/chat_store/postgres/base.py