MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / hard_delete

Method hard_delete

methods/letta/orm/sqlalchemy_base.py:443–456  ·  view source on GitHub ↗

Permanently removes the record from the database.

(self, db_session: "Session", actor: Optional["User"] = None)

Source from the content-addressed store, hash-verified

441
442 @handle_db_timeout
443 def hard_delete(self, db_session: "Session", actor: Optional["User"] = None) -> None:
444 """Permanently removes the record from the database."""
445 logger.debug(f"Hard deleting {self.__class__.__name__} with ID: {self.id} with actor={actor}")
446
447 with db_session as session:
448 try:
449 session.delete(self)
450 session.commit()
451 except Exception as e:
452 session.rollback()
453 logger.exception(f"Failed to hard delete {self.__class__.__name__} with ID {self.id}")
454 raise ValueError(f"Failed to hard delete {self.__class__.__name__} with ID {self.id}: {e}")
455 else:
456 logger.debug(f"{self.__class__.__name__} with ID {self.id} successfully hard deleted")
457
458 @handle_db_timeout
459 def update(self, db_session: Session, actor: Optional["User"] = None, no_commit: bool = False) -> "SqlalchemyBase":

Callers 14

delete_sourceMethod · 0.45
delete_fileMethod · 0.45
delete_message_by_idMethod · 0.45
delete_groupMethod · 0.45
delete_job_by_idMethod · 0.45
delete_blockMethod · 0.45
delete_llm_batch_itemMethod · 0.45
delete_sandbox_configMethod · 0.45
delete_passage_by_idMethod · 0.45

Calls 4

commitMethod · 0.80
rollbackMethod · 0.80
debugMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected