Open josecelano opened 3 months ago
I think the problem is we create the tables when we instantiate the DB driver:
pub fn build(driver: &Driver, db_path: &str) -> Result<Box<dyn Database>, Error> {
let database = match driver {
Driver::Sqlite3 => Builder::<Sqlite>::build(db_path),
Driver::MySQL => Builder::<Mysql>::build(db_path),
}?;
database.create_database_tables().expect("Could not create database tables.");
Ok(database)
}
I think we should move that logic out of the driver constructor and use an internal flag to call create_database_tables
only once (the first time the driver is used).
Usually, when you run the tracker for benchmarking, you disable persistency completely.
Even if you don't use the database at all, you need to add either the database configuration:
Or to create the default location for the database:
Otherwise, you get this error:
Besides, the database is created and tables too.
I think the app should not:
If none of the features requiring persistency is enabled.
cc @da2ce7