diff --git a/src/database/sql_database.py b/src/database/sql_database.py index a40217e..e16bcd1 100644 --- a/src/database/sql_database.py +++ b/src/database/sql_database.py @@ -9,6 +9,11 @@ class SQL_Database: sql_type_list = [int, float, str] + def __init__(self): + self.conn = None + self.config_id = None + self._database_name = 'database.db' + def default_config_id(method): """Decorator used to set the default config_id""" @@ -37,13 +42,6 @@ class SQL_Database: return new_method - - def __init__(self): - self.conn = None - self.config_id = None - self._database_name = 'database.db' - - def get_current_config(self): """Get the current config_id from the config table.""" return self.query_one_item("SELECT MAX(id) FROM config") @@ -226,6 +224,10 @@ class SQL_Database: cur.execute(query) return cur.fetchone() + def remove_database(self): + """Remove the current database file using the database_name attribute.""" + os.remove(self._database_name) + def past_runs(self): """Show a summerization of the past runs that the user has done."""