Remove the object's associated rows from the database.
(self)
| 647 | self.clear_dirty() |
| 648 | |
| 649 | def remove(self): |
| 650 | """Remove the object's associated rows from the database.""" |
| 651 | with self.db.transaction() as tx: |
| 652 | tx.mutate(f"DELETE FROM {self._table} WHERE id=?", (self.id,)) |
| 653 | tx.mutate( |
| 654 | f"DELETE FROM {self._flex_table} WHERE entity_id=?", (self.id,) |
| 655 | ) |
| 656 | |
| 657 | def add(self, db: D | None = None): |
| 658 | """Add the object to the library database. This object must be |