PavidR
PavidR
Explore posts from servers
PPrisma
Created by PavidR on 3/13/2025 in #help-and-questions
Context : Shops and Orders. Autoincremented "number" by shopId
Hello, Let's say I've 2 entities in my schema. Shop and Order.
model Shop {
id String
}

model Order {
id String
shopId String
number Int @default(autoincrement())

@@unique([shopId, number])
}
model Shop {
id String
}

model Order {
id String
shopId String
number Int @default(autoincrement())

@@unique([shopId, number])
}
Is there a way to achieve uniqueness on number field based on shopId value please, and keep it autoincremented ?
7 replies
TtRPC
Created by PavidR on 11/16/2024 in #❓-help
Make server side tRPC calls on an external tRPC server ?
Hello, there is a very valid discussion on github that has still not been discussed : https://github.com/trpc/trpc/discussions/5989
2 replies
TtRPC
Created by PavidR on 8/20/2024 in #❓-help
Duplicated tRPC server-side calls
Hello, I'm using the CT3App tRPC implementation, server-side, with createHydrationHelpers stuff from @trpc/react-query/rsc I'm also using generateMetadata function from NextJS App Router. But ... I thought there would be some cache involved, because now my backend is hit 2 times : - 1 when generating metadatas - 1 in the RSC that prefetch my data Is there any way around this, please ?
2 replies
TtRPC
Created by PavidR on 7/31/2024 in #❓-help
Correct tRPC implementation (NextJS AppDir)
55 replies