Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure SQL-Connector #83

Open
LukasFehring opened this issue Jan 9, 2023 · 0 comments
Open

Restructure SQL-Connector #83

LukasFehring opened this issue Jan 9, 2023 · 0 comments

Comments

@LukasFehring
Copy link
Collaborator

LukasFehring commented Jan 9, 2023

Problem in the current code structure

As of now, the database_connector.DatabaseConnector (and its subclasses) handle support two main functionalities

  1. Starting and maintaining connections to the database
  2. Generating rows from the given input parameters
  3. Due to the current code structure we have the table's name in all classes. However, this might be unnecessary.
  4. Naming of variables and functions regarding underscores before the function's name is inconsistent.
    In addition to these functionalities, a DatabaseConnector object is held by all ResultProcessor instances in addition to the PyExperimenter object and creates the log-tables.

Together this leads to the DatabaseConnector code being hard to understand and adapt.

How to fix the problem

This problem should be approached by splitting the connector into Interface classes (for mysql, sqlite,...) and classes that generate the entries.
In addition, it is a goal for an experimenter to only use one connection at a time (currently multiple threads can have connections simultaneously) that inserts, deletes, and modifies numerous table entries at a time.
Another goal is that the functions used for creating tables and fetching data, ... get adapted not to use execute. This is motivated by the goal of using prepared statements for escaping instead of a separate function as mentioned in #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants