tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.37k stars 355 forks source link

Support await `tortoise.contrib.fastapi.RegisterTortoise` #1662

Closed waketzheng closed 5 days ago

waketzheng commented 1 week ago

Description

  1. Run make style
  2. Update changelog
  3. Update RegisterTortoise class document
  4. Use typing.Self to improve type hint
  5. Support await for RegisterTortoise and add testcase for this feature

Motivation and Context

Sometimes, I want to use await RegiterTortoise(...) instead of async with RegiterTortoise(...)

How Has This Been Tested?

make ci

Checklist: