Description
The SQL engine is always called when init taipy, so that whatever the db_location is set by the Config.configure_core() method, the db_location will always be "None".
The problem is caused by:
In _sql_repository.py, there is an import
from .db._init_db import init_db
which called to the db._init_db.py file, which has an import
from ._sql_session import engine
which the engine is a global variable and will always be generated at the import.
How to reproduce
import taipy as tp
from taipy import Config
Config.configure_core(repository_type="sql", repository_properties={"db_location": "test.sqlite"})
tp.Core().run()
After running the code (with some configuration if possible), there will be a "None" file which is a SQLite database.
Expected behavior
"db_location" should be properly assigned as the path of the SQLite database.
Description The SQL engine is always called when init taipy, so that whatever the db_location is set by the
Config.configure_core()
method, the db_location will always be "None".The problem is caused by:
In
_sql_repository.py
, there is an importwhich called to the
db._init_db.py
file, which has an importwhich the
engine
is a global variable and will always be generated at the import.How to reproduce
After running the code (with some configuration if possible), there will be a "None" file which is a SQLite database.
Expected behavior "db_location" should be properly assigned as the path of the SQLite database.