1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-05-15 17:34:28 -04:00

move database from postgres/prisma to redis

This commit is contained in:
2025-03-27 09:21:22 -04:00
parent e865d9d8e5
commit bbf6e9dc66
16 changed files with 283 additions and 651 deletions
-17
View File
@@ -1,17 +0,0 @@
import { PrismaClient } from "@prisma/client";
// creating PrismaClient here prevents next.js from starting too many concurrent prisma instances and exhausting the
// number of connection pools available (especially when hot reloading from `next dev`).
// https://www.prisma.io/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices
const prismaClientSingleton = () => {
return new PrismaClient();
};
declare const globalThis: {
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
} & typeof global;
export const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();
if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
+6
View File
@@ -0,0 +1,6 @@
import { Redis } from "@upstash/redis";
// Initialize Redis
const redis = Redis.fromEnv();
export default redis;