from sqlalchemy import create_engine
from backend.app.config import get_settings

connection_string = "postgresql+{drivername}://{username}:{password}@{server}:{port}/{dbname}"
db_string = connection_string.format(
    drivername="psycopg2",  # You'll need to use psycopg2 driver for PostgreSQL
    username=get_settings().DB_USERNAME,
    password=get_settings().DB_PASSWORD,
    server=get_settings().DB_HOST,
    port=get_settings().DB_PORT,
    dbname=get_settings().DB_NAME,
)

db_engine = create_engine(db_string, pool_size=5, max_overflow=5)
