我截断了这段代码,以便使用Sqlalchemy 在fastapi 中获取Sessionlocal。好吧,当我使用return 而不是Yield 时。我的代码仍然有效。然后,我不明白使用Yield 的原因。
確定! 回上一頁