David
Explore posts from serversPPrisma
•Created by David on 11/4/2024 in #help-and-questions
Argument "columnName" is missing (v5.21.1)
Attempting to run a create query with an unchecked input, but getting a "argument is missing" error. This is the query:
So
channelMetaCampaignId
is defined, yet it is complaining that I should define the checked variant. TypeScript doesn't complain about this, only runtime3 replies
How to get line number in errors?
Hi, we are currently doing this:
to get a vague idea of what the error was, but this doesn't really help you with telling on which line it occurred. Is there a way to achieve this? Logging the trace is kind of pointless as they don't point you to your own procedure.
8 replies
Best way to get the type of the first argument for .query or .mutation
I am creating an abstraction in which I expect the consumer to pass the whole object that is passed as the first argument of
.query
or .mutation
. But im not sure if there is a helper type to get this type from our instance?10 replies
PPrisma
•Created by David on 5/7/2024 in #help-and-questions
Set max execution timeout
Hi, is there a way with Prisma to set a max query execution timeout?
I know there isn't really a built-in way, but was hoping there is a workaround available such as running a raw query directly after client initialization?
7 replies
standaloneMiddleware: Merge ctx/meta/input types
Using standaloneMiddleware, it would be great to merge the types (ctx, input, meta) with what is already there when passing that middleware.
In our case:
this is because we want to be sure user.id exists in the context before allowing the usage of this middleware, but when returning like this:
next({ ctx: { ...ctx, newProp: '' } })
you would still want the context type to be merged with the original so your queries and mutations get the complete context.1 replies
How would batching result in a single database query?
On the
httpBatchStreamLink
docs it says that multiple query calls could result in a single database query. How would that work? Should you expect the passed input to possibly be an array to allow for this?
5 replies
Why do some examples create PrismaClient in context, and others don’t
Is there a specific reason to do this or not to do this? I can imagine with the new Prisma extension feature you could do some handy things like attaching multi tenancy data to each query beforehand
1 replies
Revalidate API route from procedure
Hi, is there a way to revalidate a statically generated page from a trpc procedure?
https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration#using-on-demand-revalidation
3 replies