dynamic database

This commit is contained in:
2024-10-07 22:58:06 -04:00
parent 47475c4f34
commit a8c12f6edf
7 changed files with 81 additions and 8 deletions

View File

@@ -3,13 +3,20 @@ from sqlalchemy.engine import URL
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import declarative_base
from config import load_config
ApplicationConfig = load_config()
url = URL.create(
drivername="postgresql",
username="postgres",
password="password",
host="192.168.1.204",
database="eamco",
port=5432
username=ApplicationConfig.POSTGRES_USERNAME,
password=ApplicationConfig.POSTGRES_PW,
host=ApplicationConfig.POSTGRES_SERVER,
database=ApplicationConfig.POSTGRES_DBNAME00,
port=ApplicationConfig.POSTGRES_PORT
)
engine = create_engine(url)