update User-agent header in _fetch_data method and add __exit__ method to Database class
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user