update User-agent header in _fetch_data method and add __exit__ method to Database class

This commit is contained in:
2026-01-11 15:30:34 +00:00
parent b5a2b01402
commit 195188dcd7
2 changed files with 6 additions and 2 deletions

View File

@@ -27,4 +27,8 @@ class Database:
cursor.executemany(query, params_list)
def close(self):
self.connection.close()
self.connection.close()
print("Database connection closed.")
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()