This showcases problems when using Prisma with pgBouncer.
Do the npm dance.
> npm i --save-dev
Start the bouncer and the database with docker
:
> docker compose up -d
At this point, running migrations should always fail:
> npx prisma migrate dev
This will give you a problem dropping shadow database.
To move forward with our tests, we can use db push
that works fine:
> npx prisma db push
Now, execute the test script a few times, until it crashes:
> npx ts-node script.ts