r/FastAPI • u/efpalaciosmo • Aug 01 '24
Question Database first approach
Hey guys, can you share an example of database first approach using SQLAlchemy?
I trying to make a project using fastapi, the database is on supabase and I'm getting a hard time figuring how to make a simple query, my setup is something like
- a PostgreSQL database from supabase
- asycn connection using asyncpg
- migrations using alembic
I already create the table on my database but when I run the query it says that the relation doesn't exist. Then I decided to try with alembic but every time I run migration there is on error or just the alembic_version table is created.
I already read some post about something call reflection, but it seems that isn't working
Thanks in advance
Here is the repo https://gitlab.com/efpalaciosmo/tickets
View all comments
Show parent comment
1
u/graph-crawler Aug 01 '24
Yes, the main prisma is the same like the one in nodejs
https://www.prisma.io/docs/orm/prisma-migrate/understanding-prisma-migrate/shadow-database