forked from polka_billy/porridger
begin implementing async
This commit is contained in:
@ -66,24 +66,3 @@ class Poems(Base):#класс поэзии
|
||||
author = Column(String) # автор стихотворения
|
||||
|
||||
|
||||
# Создаем описанные выше таблицы
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
|
||||
|
||||
# from typing import AsyncGenerator
|
||||
# from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
||||
# from fastapi_users.db import SQLAlchemyBaseUserTableUUID, SQLAlchemyUserDatabase
|
||||
# # This function can be called during the initialization of the FastAPI app.
|
||||
# async def create_db_and_tables():
|
||||
# async with engine.begin() as conn:
|
||||
# await conn.run_sync(Base.metadata.create_all)
|
||||
|
||||
|
||||
# async def get_async_session() -> AsyncGenerator[AsyncSession, None]:
|
||||
# async with async_session_maker() as session:
|
||||
# yield session
|
||||
|
||||
|
||||
# async def get_user_db(session: AsyncSession = Depends(get_async_session)):
|
||||
# yield SQLAlchemyUserDatabase(session, User)
|
Reference in New Issue
Block a user