Skip to content

NepNepFFXIV/fastapi_no_orm

Repository files navigation

FastAPI with asyncpg (No ORM)

FastAPI asyncpg PostgreSQL

A demonstration project showing how to build a FastAPI application using asyncpg for direct PostgreSQL database access without an ORM.

Why This Approach?

For the ORM haters who just want to write SQL and be done with it! 😤

  • Raw SQL Power: Write queries that actually make sense instead of fighting with ORM magic
  • Speed Demon: asyncpg is stupidly fast - why add layers when you don't need them?
  • What You See Is What You Get: No hidden queries, no surprise N+1 problems, just pure SQL
  • Debug Like a Pro: When your query is slow, you know exactly what's happening (no ORM black box)
  • Database Features: Use all the cool PostgreSQL features without ORM limitations

How to Run

Prerequisites

  • Python 3.13+
  • UV package manager

Setup

  1. Install dependencies:

    uv sync
  2. Start PostgreSQL:

    docker-compose up -d postgres
  3. Run database migrations:

    uv run alembic upgrade head

    (Using Alembic for database migrations)

  4. Start the application:

    make run

The API will be available at http://localhost:8000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors