Skip to content

Instantly share code, notes, and snippets.

View biaomingzhong's full-sized avatar
🎯
Focusing

biaomingzhong biaomingzhong

🎯
Focusing
  • Guang Zhou, China
View GitHub Profile
@daniellwdb
daniellwdb / cacheMiddleware.ts
Last active June 14, 2022 17:25
Prisma cache middleware
import type { Prisma } from "@prisma/client"
import { redis } from "../redis"
type CacheMiddlewareOptions = {
model: Prisma.ModelName
action: Prisma.PrismaAction
keys?: string[]
defaultValues?: Record<string, unknown>
ttlInSeconds: number
}

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?