Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Documentation for usage with async tools. Fixes #626 #633

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

deshetti
Copy link

@deshetti deshetti commented Aug 8, 2023

I have spent a good amount of time to figure out async implementation with SQLModel & FastAPI in one of our projects and thought this would be a helpful guide for anyone who is looking to do the same in their projects.

A simple working project is available here to test. Running the docker-compose will start the postgres with the required database: https://github.com/deshetti/sqlmodel-async-example

@github-actions
Copy link

github-actions bot commented Aug 8, 2023

📝 Docs preview for commit a5fe1d1 at: https://ececea1e.sqlmodel.pages.dev

@github-actions
Copy link

github-actions bot commented Aug 9, 2023

📝 Docs preview for commit b0081f5 at: https://049f644f.sqlmodel.pages.dev

@tiangolo tiangolo added the docs Improvements or additions to documentation label Oct 22, 2023
```

## Final code
```
Copy link

Choose a reason for hiding this comment

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

Suggested change
```
```python

Comment on lines +15 to +17
```
pip install sqlmodel asyncpg fastapi uvicorn
```
Copy link

Choose a reason for hiding this comment

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

Suggested change
```
pip install sqlmodel asyncpg fastapi uvicorn
```
```bash
pip install sqlmodel asyncpg fastapi uvicorn

)


# Ayschronous Context manager for handling database sessions

Choose a reason for hiding this comment

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

Suggested change
# Ayschronous Context manager for handling database sessions
# Asynchronous Context manager for handling database sessions

@StashOfCode
Copy link

StashOfCode commented Feb 8, 2024

@tiangolo , are you merging this in this century or next?

@moralespanitz
Copy link

@tiangolo Why don't you add the contribution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants