working on new system for importing
This commit is contained in:
@@ -9,7 +9,15 @@ from app.config import settings
|
||||
|
||||
engine = create_engine(
|
||||
settings.database_url,
|
||||
connect_args={"check_same_thread": False} if "sqlite" in settings.database_url else {}
|
||||
connect_args={
|
||||
"check_same_thread": False,
|
||||
# SQLite performance optimizations for bulk imports
|
||||
"timeout": 30,
|
||||
} if "sqlite" in settings.database_url else {},
|
||||
# Performance settings for bulk operations
|
||||
pool_pre_ping=True,
|
||||
pool_recycle=3600, # Recycle connections after 1 hour
|
||||
echo=False # Set to True for SQL debugging
|
||||
)
|
||||
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
Reference in New Issue
Block a user