Spaces:
Sleeping
Sleeping
switch config from ini to env
Browse files
innovation_pathfinder_ai/database/db_handler.py
CHANGED
@@ -2,12 +2,13 @@ from sqlmodel import SQLModel, create_engine, Session, select
|
|
2 |
from innovation_pathfinder_ai.database.schema import Sources
|
3 |
from innovation_pathfinder_ai.utils.logger import get_console_logger
|
4 |
from configparser import ConfigParser
|
5 |
-
|
|
|
6 |
|
7 |
-
|
8 |
-
|
|
|
9 |
|
10 |
-
sqlite_file_name = config.get('main', 'SOURCES_CACHE')
|
11 |
sqlite_url = f"sqlite:///{sqlite_file_name}"
|
12 |
engine = create_engine(sqlite_url, echo=False)
|
13 |
|
|
|
2 |
from innovation_pathfinder_ai.database.schema import Sources
|
3 |
from innovation_pathfinder_ai.utils.logger import get_console_logger
|
4 |
from configparser import ConfigParser
|
5 |
+
import os
|
6 |
+
from dotenv import load_dotenv
|
7 |
|
8 |
+
load_dotenv()
|
9 |
+
|
10 |
+
sqlite_file_name = os.getenv('SOURCES_CACHE')
|
11 |
|
|
|
12 |
sqlite_url = f"sqlite:///{sqlite_file_name}"
|
13 |
engine = create_engine(sqlite_url, echo=False)
|
14 |
|