David
David
Explore posts from servers
PPrisma
Created by David on 11/4/2024 in #help-and-questions
Argument "columnName" is missing (v5.21.1)
bump
3 replies
TtRPC
Created by David on 9/11/2024 in #❓-help
How to get line number in errors?
Thank you! Im using Turbopack in Next
8 replies
TtRPC
Created by David on 9/11/2024 in #❓-help
How to get line number in errors?
Im guessing this must be it then, do you have a reference where this is set up correctly that I can compare to? I do have sourceMap: true in tsconfig.
8 replies
PPrisma
Created by bill92 on 5/22/2024 in #help-and-questions
`PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime` error
Did you?
7 replies
PPrisma
Created by JayPe on 6/10/2024 in #help-and-questions
Multiple schema - node_modules - prisma client
Hey, we just do this in both of our schema.prisma files
output = "../../node_modules/@prisma/client-mysql"
output = "../../node_modules/@prisma/client-mysql"
8 replies
TtRPC
Created by David on 6/4/2024 in #❓-help
Best way to get the type of the first argument for .query or .mutation
Maybe its best I just explain what im looking to achieve. For file uploads our current flow is: 1. Get upload token through query 2. Use upload token to upload directly to S3 from browser 3. Call mutation to do something with this finished upload We currently reuse the same logic everywhere for this, but we've gotten to a point where quite often we want to do some type of server-side logic before returning an upload token, or after uploading. So I want to create a function that takes in a couple of arguments to help with this, and returns a router. So we can do something like:
const { upload ] = useUpload(trpc.path.to.specific.upload.router)

// useUpload
const upload = (args) => {
const token = await router.getUploadToken({ args })
// upload to S3
await router.onUploadFinished({ args })
}
const { upload ] = useUpload(trpc.path.to.specific.upload.router)

// useUpload
const upload = (args) => {
const token = await router.getUploadToken({ args })
// upload to S3
await router.onUploadFinished({ args })
}
10 replies
TtRPC
Created by David on 6/4/2024 in #❓-help
Best way to get the type of the first argument for .query or .mutation
Ah, is that only a v11 feature?
10 replies
TtRPC
Created by David on 6/4/2024 in #❓-help
Best way to get the type of the first argument for .query or .mutation
That looks like it can help me get what I need, thanks!
10 replies
TtRPC
Created by David on 6/4/2024 in #❓-help
Best way to get the type of the first argument for .query or .mutation
I want to do something like this:
.input(Zod).query(onUploadComplete(({ input, ctx }) => {
...
})
.input(Zod).query(onUploadComplete(({ input, ctx }) => {
...
})
10 replies
TtRPC
Created by David on 6/4/2024 in #❓-help
Best way to get the type of the first argument for .query or .mutation
That would return just the input, I assume? I want the type for the whole first argument that gets passed, incl context etc if possible
10 replies
PPrisma
Created by Florian on 5/11/2024 in #help-and-questions
Extra query into object (GetPayload)
You can use const name = {} satisfies Prisma.Type if you are above TS 4.9
5 replies
PPrisma
Created by David on 5/7/2024 in #help-and-questions
Set max execution timeout
Ah very cool, will try, thanks!
7 replies
PPrisma
Created by David on 5/7/2024 in #help-and-questions
Set max execution timeout
We use MySQL unfortunately. I should have mentioned
7 replies
PPrisma
Created by Wolverine on 5/3/2024 in #help-and-questions
How to Handle Case Insensitivity?
No description
9 replies
PPrisma
Created by Wolverine on 5/3/2024 in #help-and-questions
How to Handle Case Insensitivity?
9 replies
PPrisma
Created by fotoflo on 4/19/2024 in #help-and-questions
How to get the type of a compound query?
type Comments = typeof comments but that only works if you define the type inside the function. If you want it outside its best to abstract the query to its own function.
async function getComments() {
return await prisma.statusChecks.findMany({
where: {
urlId,
httpCode: {
notIn: [200, 301, 302, 303, 307, 308],
},
},
orderBy: {
createdAt: "desc",
},
});
}

type Comments = Awaited<ReturnType<typeof getComments>>
async function getComments() {
return await prisma.statusChecks.findMany({
where: {
urlId,
httpCode: {
notIn: [200, 301, 302, 303, 307, 308],
},
},
orderBy: {
createdAt: "desc",
},
});
}

type Comments = Awaited<ReturnType<typeof getComments>>
6 replies
PPrisma
Created by TANK on 4/25/2024 in #help-and-questions
Typescript error
That is only the type for the basic entity. Better to do type Issue = typeof issue in the place where you run the query.
5 replies
PPrisma
Created by TANK on 4/25/2024 in #help-and-questions
Typescript error
Can you show how you are defining the Issue type?
5 replies
PPrisma
Created by fotoflo on 4/19/2024 in #help-and-questions
How to get the type of a compound query?
What type exactly are you looking to get? The return of both statusCheckPromise as well as commentsPromise?
6 replies
PPrisma
Created by Bean on 4/16/2024 in #help-and-questions
union type findMany
No need for an attitude towards someone that is trying to help you, my guy
14 replies