As I play around with learning drizzle, I wondered if I could generate a drizzle schema from a master schema. I'm very close to being able to do that. As you can see in this repo I created: https://github.com/rizen/drizzle-icing/blob/main/user.ts
The code works perfectly, but problem is that when I try to use
InferModel
InferModel
to get the column types from my schema, I'm getting
type User { [x:string]: unknown;}
type User { [x:string]: unknown;}
Where the I would get the following on a hand-built table:
type User = { id: string; createdAt: Date; username: string; password: string; useAsDisplayName: "username" | "email" | "realName"; admin: boolean;}
type User = { id: string; createdAt: Date; username: string; password: string; useAsDisplayName: "username" | "email" | "realName"; admin: boolean;}
My guess is that the problem lies in the use of the