2022-06-27から1日間の記事一覧
FastAPIならasyncで全部行きたいねってことで、プロダクトのコードをFlask→FastAPIに書き直している。 で、簡単なクエリの動作確認で、こんなコードを書く。 async def get_posts(db: AsyncSession) -> List[Post]: result: Result = await db.execute(selec…
FastAPIならasyncで全部行きたいねってことで、プロダクトのコードをFlask→FastAPIに書き直している。 で、簡単なクエリの動作確認で、こんなコードを書く。 async def get_posts(db: AsyncSession) -> List[Post]: result: Result = await db.execute(selec…