__fallenreaper
__fallenreaper
TTCTheo's Typesafe Cult
Created by __fallenreaper on 3/21/2023 in #questions
create-t3-app Dockerizing base install fails with Prisma?
I am trying to learn and understand how to do things with Docker, and I saw a Deployment part of the Website which seemed great, but i seem to get stuck on the DATABASE_URL env variable. I was trying to set up a docker-compose for it, but by default it isnt showing how to stand up a separate prisma setup server of sorts. I want to flush out this a bit more, since prisma can make a postgres or various other setups, but i didnt see much regarding it when looking at how to take this base app and create the appropriate containers for it. Can someone point me in some direction on how to get this aspect working? Seems like I will need it to generate a db container, or some other mechanism. to see how I can build the rest of this aspect.
4 replies
TTCTheo's Typesafe Cult
Created by __fallenreaper on 1/23/2023 in #questions
Upsert seems to give me an error about returning type any?
Been reading through the create t3 app. Working to understand prisma, zod, and router. I created a Model like the following:
model Transcoder {
id String @id
name String
}
model Transcoder {
id String @id
name String
}
when attempting to create a router I do:
export const transcoderRouter = createTRPCRouter({
save: publicProcedure
.input(
z.object({
id: z.string(),
name: z.string()
})
)
.mutate(({ input, ctx }) => {
const { id } = input
return ctx.prisma.transcoder.upsert({
where: { id },
create: { id },
update: input
})
})
})
export const transcoderRouter = createTRPCRouter({
save: publicProcedure
.input(
z.object({
id: z.string(),
name: z.string()
})
)
.mutate(({ input, ctx }) => {
const { id } = input
return ctx.prisma.transcoder.upsert({
where: { id },
create: { id },
update: input
})
})
})
But VSCode is telling me:
Unsafe Return of any typed value.
I was thinking it would inherit a type of the model? I wasnt sure if it is related to me using typescript-eslint, BUT i didnt see other samples on the prisma website?
5 replies