Sqlite db default
Moved db creation logic to db_client.py file. Added table creation logic for both postgres and sqlite in new methods, that are then called in the existing create_db_client method.
Added a new .env variable to let the user select between sqlite and postgres. Replaced Child db classes with the parent DB Client class across the project, so that the db is dynamically maintained across everywhere.
Tested manually with db creation checks, data entry checks from running lab play experiments.
updated README to reflect the simplifications made in the overall steps.
implements #210
ABC usage in db_client is confusing, given no abstract classes are declared this leads to linter issues and is generally a bad pattern. I did not touch it as i dont know the intent here.
Looking at the readme, it seems that we ask the user to replace the PostgresDB client in code with an SQLite client as part of the setup process.
I think it would be better to use a factory pattern to select the client depending on the DB connection string (which is usually prefixed with the SQL flavour) so no user needs to modify code to get started.
What do you think @hrshtt @kantneel ?
Looking at the readme, it seems that we ask the user to replace the PostgresDB client in code with an SQLite client as part of the setup process.
I think it would be better to use a factory pattern to select the client depending on the DB connection string (which is usually prefixed with the SQL flavour) so no user needs to modify code to get started.
What do you think @hrshtt @kantneel ?
If you are referring to line 201 from the readme, then it is being removed in this pr, or is it somewhere else?
Looking at the readme, it seems that we ask the user to replace the PostgresDB client in code with an SQLite client as part of the setup process.
I think it would be better to use a factory pattern to select the client depending on the DB connection string (which is usually prefixed with the SQL flavour) so no user needs to modify code to get started.
What do you think @hrshtt @kantneel ?
In the PR i have added an explicit environment variable to select a db and the code then uses the factory to spawn the appropriate db class.
the comment on the db_client.py:ln740 from @MortenTobiasNielsen should now be resolved