FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

馃摑 Fix async example in `session.execute()` docstring & deprecation message by DanielLeviLucas 路 Pull Request #1643 路 fastapi/sqlmodel 路 GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 8 additions & 4 deletions sqlmodel/ext/asyncio/session.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ async def exec(
For example:

```Python
heroes = await session.execute(select(Hero)).scalars().all()
result = await session.execute(select(Hero))
heroes = result.scalars().all()
```

instead you could use `exec()`:

```Python
heroes = await session.exec(select(Hero)).all()
result = await session.exec(select(Hero))
heroes = result.all()
```
"""
)
Expand All @@ -145,13 +147,15 @@ async def execute(
For example:

```Python
heroes = await session.execute(select(Hero)).scalars().all()
result = await session.execute(select(Hero))
heroes = result.scalars().all()
```

instead you could use `exec()`:

```Python
heroes = await session.exec(select(Hero)).all()
result = await session.exec(select(Hero))
heroes = result.all()
```
"""
return await super().execute(
Expand Down

Back | FazBrowse Home | New Git URL