docs: add Async tutorial and fix docstring async examples (#626)#1733
Open
cscguochang wants to merge 1 commit intofastapi:mainfrom
Open
docs: add Async tutorial and fix docstring async examples (#626)#1733cscguochang wants to merge 1 commit intofastapi:mainfrom
cscguochang wants to merge 1 commit intofastapi:mainfrom
Conversation
Contributor
📝 Docs previewLast commit a1e82c3 at: https://00ece0bc.sqlmodel.pages.dev Modified Pages |
YuriiMotov
reviewed
Feb 3, 2026
Member
YuriiMotov
left a comment
There was a problem hiding this comment.
@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() |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.executeandAsyncSession.execdocstrings whereawaitwas used in a way that would raise an AttributeError.Key Changes
docs/tutorial/async/index.md.await session.exec().all()to(await session.exec()).all()in docstrings.Verified with actual execution logic.