"""SQLAlchemy engine et session — supporte mode reel et demo"""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from .config import DATABASE_URL, DATABASE_URL_DEMO

# Production engine
engine = create_engine(DATABASE_URL, pool_pre_ping=True, pool_size=10)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

# Demo engine
engine_demo = create_engine(DATABASE_URL_DEMO, pool_pre_ping=True, pool_size=5)
SessionLocalDemo = sessionmaker(autocommit=False, autoflush=False, bind=engine_demo)
