Skip to content

Xeydra/fastapi-sqlmodel-alembic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI + SQLModel + Alembic

Sample FastAPI project that uses async SQLAlchemy, SQLModel, Postgres, Alembic, and Docker.

Want to learn how to build this?

Check out the post.

Want to use this project?

$ docker-compose up -d --build
$ docker-compose exec web alembic upgrade head

Sanity check: http://localhost:8004/ping

Add a song:

$ curl -d '{"name":"Midnight Fit", "artist":"Mogwai", "year":"2021"}' -H "Content-Type: application/json" -X POST http://localhost:8004/songs

Get all songs: http://localhost:8004/songs

Open psql:

docker-compose exec db psql --username=postgres --dbname=foo \dt

access sh in docker:

docker-compose exec web /bin/sh

Migrations

Create: docker-compose exec web alembic revision --autogenerate -m "commit message"

Run: docker-compose exec web alembic upgrade head

Documentation

docker run --rm --network fastapi-sqlmodel-alembic_default -v ${PWD}:/work -w /work k1low/tbls doc postgresql://postgres:postgres@db:5432/foo?sslmode=disable

ToDos

23.08:

  • Create Colors & initial UserQuestion with Script
  • create UserQuestion Models & Endpoint
  • create UserData Models & Endpoint
  • get UserData Models & Endpoint ...
  • Auth:
    • Tables
    • Library
    • Login ermöglichen & Überlegen --> Frontend!

About

Sample FastAPI project that uses async SQLAlchemy, SQLModel, Postgres, Alembic, and Docker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.6%
  • Mako 3.5%
  • Dockerfile 2.9%