+ id_type: type[Any] = int
+
+ @classmethod
+ def from_table_row(cls, db_conn: DatabaseConnection, row: Row) -> Any:
+ """Make from DB row, write to DB cache."""
+ obj = cls(*row)
+ assert isinstance(obj.id_, cls.id_type)
+ cache = getattr(db_conn, f'cached_{cls.table_name}')
+ cache[obj.id_] = obj
+ return obj