Hacker News new | past | comments | ask | show | jobs | submit login

Did you know it’s impossible to set a statement timeout for your DB connections in prisma? There’s no hook to run commands when a connection in a pool is established, and there’s no exposed setting for it. The only way to manage it is either to set it at the user level or to set up whatever they call a middleware layer (client extension?) that issues the command to set the timeout before every single query

An engine that doesn’t allow you to set per-connection settings effectively is pretty crazy IMO.




It's possible now with the built-in "db adapter" plugin. I also have lots of misgivings about the Prisma ORM, but this particular thing is possible now.


Can’t find any docs on this, could you point me to what you’re referencing?


Configure Prisma with https://www.prisma.io/docs/orm/overview/databases/postgresql...

Then you can pass `statement_timeout` when you create the `pg.Pool`


Oh I see, thanks! So you just need to opt out of their drivers entirely and configure with the alternative package’s driver.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: