Moaaz
11/12/2021, 8:25 PMVersion
model for each model.
E.g.
model User {
id: Int
name: String
}
generated model:
model UserVersion {
id: Int
data: Json
userId Int
user User @relation(fields: [userId], references: [id])
}
Jason Abbott
11/13/2021, 2:46 AMMoaaz
11/13/2021, 2:50 AMMoaaz
11/13/2021, 2:56 AMprisma-client-js
generator? 🤔Jason Abbott
11/13/2021, 3:48 AM*Version
interfaces for all your models wouldn't be too hard (and yes, that's the repo I had in mind).
But I realized what you probably want is not just the client typings but real Prisma models that the other Prisma tooling can utilize to create migrations and its nice client interactions.
To my understanding, that would need a process before this generator stuff, to maybe produce an altered .prisma
file that is then fed to the regular Prisma generator.
You could leverage the Prisma SDK to get the .prisma
AST to make that job easier but I think it might otherwise be a bit outside the scope of the usual Prisma generators.Moaaz
11/13/2021, 9:38 PM