P
Prismaā€¢2mo ago
gaurav1998

npx prisma migrate dev --name init from tutorial not working

Once I get to the part in the supabase prisma tutorial where I run the command npx prisma migrate dev --name init the terminal gets stuck at:
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "aws-0-us-west-1.pooler.supabase.com:6543"
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "aws-0-us-west-1.pooler.supabase.com:6543"
Any ideas what the issue is here?
Solution:
Hey @Nurul that solution works! So does this mean I won't be using the connection pooler?
Jump to solution
3 Replies
Nurul
Nurulā€¢2mo ago
Hey @gaurav1998 šŸ‘‹ Can you try using the non-pooled connection string, the one with port 5432 and check?
Solution
gaurav1998
gaurav1998ā€¢2mo ago
Hey @Nurul that solution works! So does this mean I won't be using the connection pooler?
jonfanz
jonfanzā€¢2mo ago
No, you can. You just need a direct URL (as in not a pooled connection) for migrations. This part of our docs goes into a bit more detail: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/pgbouncer#prisma-migrate-and-pgbouncer-workaround
Configure Prisma Client with PgBouncer | Prisma Documentation
An external connection pooler like PgBouncer holds a connection pool to the database, and proxies incoming client connections by sitting between Prisma Client and the database. This reduces the number of processes a database has to handle at any given time.