Using Prisma with Azure SQL Hyperscale
Is anyone using Prisma with Azure SQL Hyperscale? I am running into an issue that when the sql azure scales up or down there is a massive slow down in the application and errors from disconnections of the connection pooling.
I am curious how others may have solved this. In .NET's EF they had automatic retry logic but is there an equavaliant in Prisma?
6 Replies
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into
#ask-ai
if you get antsy for a second opinion!#ask-ai
Hey Jonathan 👋
I haven’t used Azure SQL Hyperscale personally. Based on your use case, I think you can use $connect explicitly, whenever you get a disconnection error.
Would something like that work?
https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections/connection-management#calling-connect-explicitly
Connection management | Prisma Documentation
This page explains how database connections are handled with Prisma Client and how to manually connect and disconnect your database.
I have struggled with this also, have you found a good solution?
Wait, I just tried to post on my own question... what a day
I haven't used Hyperscale so I am not aware of a solution unfortunately.
I would recommend opening a GitHub Issue if the error persists, so that our ORM team can provide their insights.
https://github.com/prisma/prisma/issues/
GitHub
Issues · prisma/prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB - Issues · prisma/prisma
Ok I have posed one https://github.com/prisma/prisma/issues/27024
GitHub
Prisma Disconnecting from SQL Azure Hyperscale · Issue #27024 · p...
Bug description When using Azure SQL Hyperscale prisma will get disconnected from the connection pool and cause the application to crash as it is unable to connect to the database. This seems to ha...