Add the database file path now is read by the configuration file

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2025-07-16 16:01:34 -03:00
parent a540347127
commit bdaa37e355
3 changed files with 77 additions and 15 deletions
+4 -3
View File
@@ -5,16 +5,17 @@ from pathlib import Path
import os
import shutil
from pilgrim.utils import ConfigManager
Base = declarative_base()
class Database:
def __init__(self,):
db_path = "./"
def __init__(self,config_manager:ConfigManager):
db_path = config_manager.database_url
self.engine = create_engine(
f"sqlite:///{db_path}",
f"sqlite:///{config_manager.database_url}",
echo=False,
connect_args={"check_same_thread": False},
)