Skip to content

Commit bb633b0

Browse files
committed
remove unnecessary import, update readme
1 parent 448d472 commit bb633b0

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
11
# FastAPI + SQLModel + Alembic
2+
3+
Sample FastAPI project that uses async SQLAlchemy, SQLModel, Postgres, Alembic, and Docker.
4+
5+
## Want to learn how to build this?
6+
7+
Check out the [post](https://testdriven.io/blog/fastapi-sqlmodel/).
8+
9+
## Want to use this project?
10+
11+
```sh
12+
$ docker-compose up -d --build
13+
$ docker-compose exec web alembic upgrade head
14+
```
15+
16+
Sanity check: [http://localhost:8004/ping](http://localhost:8004/ping)
17+
18+
Add a song:
19+
20+
```sh
21+
$ curl -d '{"name":"Midnight Fit", "artist":"Mogwai", "year":"2021"}' -H "Content-Type: application/json" -X POST http://localhost:8004/songs
22+
```
23+
24+
Get all songs: [http://localhost:8004/songs](http://localhost:8004/songs)

project/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from sqlalchemy.future import select
33
from sqlalchemy.ext.asyncio import AsyncSession
44

5-
from app.db import get_session, init_db
5+
from app.db import get_session
66
from app.models import Song, SongCreate
77

88
app = FastAPI()

0 commit comments

Comments
 (0)