mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-10 01:20:16 +00:00
Add the database file path now is read by the configuration file
This commit is contained in:
parent
a540347127
commit
bdaa37e355
@@ -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},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user