Closed victorterpstra closed 2 years ago
Fixed in v0.5.1.1b Challenge was the delete scenario from tables that do not exist. I.e. since no tables are created in the new schema, scenario data cannot be deleted from table. Fixed by checking of the table exists before executing the DELETE FROM. After this fix, the AutoScenarioDbTable seems to work fine.
The AutoScenarioDbTable needs to be tested and debugged. Might not be working properly.
Background Typically, one would define a subclass of ScenarioDbTable to encode the schema information of a table (columns, data types, PKs, FKs, etc.) But that can be a lot of work. SQLAlchemy is capable of automatically generating the DB table definition from a DataFrame. At some early point in development, this feature was working. That is what the AutoScenarioDbTable is designed for, i.e. when a table is included in the ScenarioDbManager subclass using the AutoScenarioDbTable as the class, the ScenarioDbManager should be able to insert the data based on the DataFrame columns and datatypes. Avoiding the need to explicitly define all columns.
TODO: