Prisma method call return type of failed SELECT
I am writing my own auth service with node & ts when I came up with a question I cannot seem to find the answer to anywhere online: When a prisma method call such as .findUnique() or .update() cannot find a row that satisfies the where condition, what does the method call return?
Prisma still uses production database instead of the shadow database
Problem Description When I try to execute bunx prisma migrate dev, Prisma doesn’t connect to my shadow database, even though I have configured SHADOW_DATABASE_URL in my environment variables. Below are the relevant code snippets and output: schema.prisma: datasource db { provider = “mysql” url = env(“DATABASE_URL”) shadowDatabaseUrl = env(“SHADOW_DATABASE_URL”) } .env: SHADOW_DATABASE_URL=’mysql://root:root@localhost:3307/kessoku’ DATABASE_URL=’mysql://ve****8:Q****Rz@d******0.*.**:3306/ve****8′ Command Output: […]
Prisma return type express
export const findManyPost = async (args: Prisma.PostFindManyArgs) => { try { const posts = await prisma.post.findMany(args) return posts } catch (err) { … error handler } } Im still noob with typescript. Im trying to extract out the prisma calls to its own services by model. The problem is i have these array and other […]