Fastapi CRUD With Postgres

fast api with postgres sqlalchemy and alembic

In this tutorial we learn to create REST Apis with fastapi. We are going to use:

  • FastApi for creating APIs
  • PostgreSQL as a database
  • SQLAlchemy as an ORM tool
  • Alembic as a migration tool

Tech and tools used

  • Linux os (you can use window or mac also. But with windows your commands might be a little different. I suggest you to use GitBash in windows)
  • I am using uv to create project, you can download it from here
  • Python 3.12
  • VS Code (code editor) with extension Python by microsoft
  • PostgreSQL (I am using it in a docker container, you can use installed version too)

The reason I am using uv, because it is pretty fast and I can easily manage dependencies with it.

[Read More]