We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fa4f7b commit 794d8bcCopy full SHA for 794d8bc
src/fastsqla.py
@@ -1,7 +1,7 @@
1
import math
2
import os
3
from collections.abc import AsyncGenerator, Awaitable, Callable, Iterable
4
-from contextlib import asynccontextmanager
+from contextlib import _AsyncGeneratorContextManager, asynccontextmanager
5
from typing import Annotated, Generic, TypeVar, TypedDict
6
7
from fastapi import Depends, FastAPI, Query
@@ -78,7 +78,9 @@ class State(TypedDict):
78
fastsqla_engine: AsyncEngine
79
80
81
-def new_lifespan(url: str | None = None, **kw):
+def new_lifespan(
82
+ url: str | None = None, **kw
83
+) -> Callable[[FastAPI], _AsyncGeneratorContextManager[State, None]]:
84
"""Create a new lifespan async context manager.
85
86
It expects the exact same parameters as
0 commit comments