Files
worldquant-alpha-system/backend/app/db.py
T
yuxuanhui 3cd280d068 feat: add initial frontend setup with styles, types, and testing framework
- Created a global CSS file for styling the frontend with responsive design.
- Introduced TypeScript types for various entities including Research, Alpha, and Account.
- Implemented Playwright tests for account management and data synchronization workflows.
- Configured TypeScript with strict settings and included necessary libraries.
- Set up Vite as the build tool with React plugin and API proxy configuration.
- Added a Python script to initialize environment variables securely.
2026-09-07 14:54:20 +08:00

9 lines
350 B
Python

"""Async database sessions; each request and background operation owns its transaction."""
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
def create_database(url: str):
engine = create_async_engine(url, pool_pre_ping=True, hide_parameters=True)
return engine, async_sessionmaker(engine, expire_on_commit=False)