1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-18 18:07:37 +03:00

EDDNSender: Add delete_message() method

This was tested by temporary code in `convert_legacy_file()` to delete
the last added row once all done.
This commit is contained in:
Athanasius 2022-09-29 16:59:34 +01:00 committed by Athanasius
parent 86ff787aed
commit 09f646a249
No known key found for this signature in database
GPG Key ID: 772697E181BB2767

View File

@ -254,6 +254,20 @@ class EDDNSender:
return self.db.lastrowid
def delete_message(self, row_id: int) -> None:
"""
Delete a queued message by row id.
:param row_id:
"""
self.db.execute(
"""
DELETE FROM messages WHERE id = :row_id
""",
{'row_id': row_id}
)
self.db_conn.commit()
def convert_legacy_file(self):
"""Convert a legacy file's contents into the sqlite3 db."""
try: