docs: Add documentation for async SQLModel usage #1757
+265
−1
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.
Add Documentation for Async SQLModel Usage
Description
This PR adds comprehensive documentation for using SQLModel with
asyncandawait, resolving Issue #626.Although SQLModel has had
AsyncSessionsupport for some time, it was not documented in the official tutorial or user guide. This PR addresses that by adding a new tutorial section dedicated to asynchronous usage.Changes
Documentation
docs/tutorial/async/index.md: A new tutorial page covering:create_async_engine.aiosqlitefor asynchronous SQLite support.AsyncSessionand theexec()method.selectinload).docs/advanced/index.mdto link to the new async tutorial.mkdocs.ymlto include the new tutorial in the navigation under the Advanced User Guide.Source Code Examples
docs_src/tutorial/async/:tutorial001_py310.py: Modern Python 3.10+ async example.tutorial001_py39.py: Python 3.9 async example.tutorial001.py: Baseline async example.Library Improvements
sqlmodel/ext/asyncio/__init__.pyto exportAsyncSession, allowing for cleaner imports:Related Issues
Fixes #626