So I get my db which is a PrismaClient with this piece of code. We also have 2 databases which is up all the time and synced. Are there any way to use multiple database urls so if one fails it will go to the next one?
export const db =
globalForPrisma.prisma ??
new PrismaClient({
log: process.env.NODE_ENV === 'development' ? ['error'] : ['error'],
// Anyway to use multiple URLs here if one of them is failing
datasourceUrl: process.env.DATABASE_URL,
});
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db;