# Python
import os

# SQLAlchemy
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

# Dotenv
from dotenv import load_dotenv

load_dotenv()

DB_CONNECTION = os.getenv("DB_CONNECTION")
DB_USERNAME = os.getenv("DB_USERNAME")
DB_PASSWORD = os.getenv("<PASSWORD>")
DB_HOST = os.getenv("DB_HOST")
DB_DATABASE = os.getenv("DB_DATABASE")

SQLALCHEMY_DATABASE_URL = (
    DB_CONNECTION
    + "://"
    + DB_USERNAME
    + ":"
    + DB_PASSWORD
    + "@"
    + DB_HOST
    + "/"
    + DB_DATABASE
)

engine = create_engine(SQLALCHEMY_DATABASE_URL)


SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)


Base = declarative_base()

# Python
import os

# SQLAlchemy
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

# Dotenv
from dotenv import load_dotenv

load_dotenv()

DB_CONNECTION = os.getenv("DB_CONNECTION")
DB_USERNAME = os.getenv("DB_USERNAME")
DB_PASSWORD = os.getenv("<PASSWORD>")
DB_HOST = os.getenv("DB_HOST")
DB_DATABASE = os.getenv("DB_DATABASE")

SQLALCHEMY_DATABASE_URL = (
    DB_CONNECTION
    + "://"
    + DB_USERNAME
    + ":"
    + DB_PASSWORD
    + "@"
    + DB_HOST
    + "/"
    + DB_DATABASE
)

engine = create_engine(SQLALCHEMY_DATABASE_URL)


SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)


Base = declarative_base()

# Python # SQLAlchemy # Dotenv