You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQLModel supports asynchronous database operations out of the box using SQLAlchemy's async features and the `AsyncSession` provided by SQLModel.
4
+
5
+
## When to use Async
6
+
7
+
Asynchronous programming is particularly useful for Web APIs (like FastAPI) that handle many concurrent connections and spend much of their time waiting for the database to respond.
8
+
9
+
## Create the Async Engine
10
+
11
+
To use async, you need an async database driver (like `aiosqlite` for SQLite or `asyncpg` for PostgreSQL).
12
+
13
+
```python
14
+
from sqlalchemy.ext.asyncio import create_async_engine
0 commit comments