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

docs: add Async tutorial and fix docstring async examples (#626) by cscguochang · Pull Request #1733 · fastapi/sqlmodel · GitHub

Repository navigation

docs: add Async tutorial and fix docstring async examples (#626) - #1733

Closed
cscguochang wants to merge 1 commit into
fastapi:mainfrom
cscguochang:docs/async-tutorial
Closed

cscguochang wants to merge 1 commit into
fastapi:mainfrom
cscguochang:docs/async-tutorial

Conversation

Copy link
Copy Markdown

Summary

This PR addresses Issue #626 by adding a foundational tutorial for using SQLModel with Async. It also fixes incorrect code examples in the AsyncSession.execute and AsyncSession.exec docstrings where await was used in a way that would raise an AttributeError.

Key Changes

  • Created docs/tutorial/async/index.md.
  • Corrected await session.exec().all() to (await session.exec()).all() in docstrings.

Verified with actual execution logic.

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

📝 Docs preview

Last commit a1e82c3 at: https://00ece0bc.sqlmodel.pages.dev

Modified Pages

YuriiMotov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@cscguochang, thanks for your interest and efforts!

I think adding async docs requires more complex approach (re-exporting necessary function and types, probably adjusting some of them, explaining some concepts, writing complete code examples, all code examples should be covered by tests).


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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We already have PR for this: #1643

svlandeg closed this Feb 6, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL