Hi, I am using Prisma + Nesjts and Postgres (Postg...
# orm-help
d
Hi, I am using Prisma + Nesjts and Postgres (PostgresSQL 14 + pgAdmin). Every time I launch my backend application, database is not responding for the first time. I always need to go to pgAdmin or launch
npx prisma studio
to interact with the database to make it work again. It seems like db is sleeping or is in idle state. Is there any way to set my local postgres db would be always reachable? Thanks 💟
n
Hey Dominik 👋 When you say the database is not responding for the first time, does this mean that your first prisma query fails every time and only the subsequent queries work?
d
Nope, it fails every time until I manually interact with my postgres DB. Then it works fine. I think it has nothing to do with prisma. Sorry for posting it in prisma context but I was just wondering if anybody has any experience with it
n
Are you using local PostgreSQL or any hosted database solution?
d
local
n
Can you try using docker image of PostgreSQL and see if you are having the same behaviour?
d
I tried to launch postgres inside docker container and result is the same. • I launched docker postgres container • launched backend • queried backend • there is an error as shown in the picture above • I run
npx prisma studio
and thus interact with db • query backend again and it works now
n
Could this be due to the PostgreSQL version, maybe?