how to infer the type of the db for the postgres driver
hey hey,
i am just starting to use drizzle. i really like it!
i want to pass the db to another function to avoid the need to recreate it, for that i need to know the type of the db const.
can anyone tell me, how to infer it?
my question is, how i can infer the type of db for the following code
2 Replies
i tried the code snippet from https://github.com/drizzle-team/drizzle-orm/issues/695#issuecomment-2126704308
but i dont know how to use it.
when using it like this:
i get the message
but i dont know what and how i should pass to InferQueryModel
besides that the code snippet from the github issue gives me the following messages
and
GitHub
Implement infering table model with relations · Issue #695 · drizzl...
Prisma API: import { Prisma } from '@prisma/client' // 1: Define a type that includes the relation to
Post
const userWithPosts = Prisma.validator<Prisma.UserDefaultArgs>()({ include...Try this: