Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 746 Bytes

README.md

File metadata and controls

42 lines (25 loc) · 746 Bytes

Async SQLAlchemy usage with FastAPI

This project demonstrates async usage of SQLAlchemy 1.4 with FastAPI.

Read the article: Async SQLAlchemy with FastAPI.

Installation

To run the example, change the DATABASE_URL in fastapi_asyncalchemy/db/base.py.

To install the project:

poetry install

To run the examples, we need to enter the virtual environment:

poetry shell

Create the database tables:

python main.py

Run FastAPI with Uvicorn:

uvicorn main:app --reload

You can send HTTP requests from http://127.0.0.1:8000/docs.

Licence

Author: Petr Stříbný

License: The MIT License (MIT)