feat(db): delete_score(score_id)

This commit is contained in:
283375 2023-06-28 01:33:12 +08:00
parent c1085c1f65
commit 15beeb5f35

View File

@ -260,3 +260,10 @@ class Database(metaclass=Singleton):
) )
conn.commit() conn.commit()
self.__trigger_update_hooks() self.__trigger_update_hooks()
def delete_score(self, score_id: int):
with self.conn as conn:
cursor = conn.cursor()
cursor.execute("DELETE FROM scores WHERE id = ?", (score_id,))
conn.commit()
self.__trigger_update_hooks()