direct connection

This commit is contained in:
Kartik Sarangmath
2025-08-07 16:39:56 -07:00
parent d0f7f52d26
commit 4432da01bd

View File

@@ -5,15 +5,13 @@ from sqlalchemy.orm import Session, sessionmaker
from ..config.settings import settings
# For Supabase session mode pooler (port 5432)
# Single process configuration - maximize pool usage
engine = create_engine(
settings.database_url,
pool_size=10, # Use most of the 15 connection limit
max_overflow=4, # Allow overflow up to 14 total (under 15 limit)
pool_timeout=10, # Fast timeout for better responsiveness
pool_recycle=3600, # Recycle after 1 hour
pool_pre_ping=False, # Skip pre-ping since Supabase pooler handles connection health
pool_size=20,
max_overflow=10,
pool_timeout=30,
pool_recycle=3600,
pool_pre_ping=True,
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)