Initial commit: Robot ökoszisztéma v2.0 - Stabilizált jármű és szerviz robotok
This commit is contained in:
18
code-server-config/data/User/History/-313e58/TEMn.py
Executable file
18
code-server-config/data/User/History/-313e58/TEMn.py
Executable file
@@ -0,0 +1,18 @@
|
||||
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker
|
||||
from app.core.config import settings
|
||||
|
||||
# Create the Async Engine
|
||||
engine = create_async_engine(settings.DATABASE_URL, echo=False, future=True)
|
||||
|
||||
# Create the Session Factory
|
||||
AsyncSessionLocal = async_sessionmaker(
|
||||
engine,
|
||||
class_=AsyncSession,
|
||||
expire_on_commit=False,
|
||||
autoflush=False
|
||||
)
|
||||
|
||||
# Dependency for FastAPI Routers
|
||||
async def get_db():
|
||||
async with AsyncSessionLocal() as session:
|
||||
yield session
|
||||
Reference in New Issue
Block a user