[FEATURE] - Custom generator
foyarash opened this issue ยท 2 comments
Summary
Currently, generating we are using prisma-json-schema-generator
to generate a JSON schema that we then have to import and pass into getNextAdminProps
. This requires an extra dependency installation and an extra import of something that the user should not really care about.
The custom generator would allow us to add prisma-json-schema-generator
as a dependency of next-admin, and to output the JSON schema directly in the node_modules (for example node_modules/.next-admin/json-schema.json
). it would also allow us, in the future, to add some more customization to the JSON schema that would make the DMMF obsolete, since we could add all the DMMF information into the JSON schema.
Basic Example
generator nextAdmin {
provider = "@premieroctet/next-admin/generator"
}
Drawbacks
No response
Unresolved questions
No response
Really like this idea! If the DMMF is eventually deprecated, this can allow in the future to support different ORMs, for example Drizzle ๐
Really like this idea! If the DMMF is eventually deprecated, this can allow in the future to support different ORMs, for example Drizzle ๐
Exactly, this is the ultimate goal of the lib, to be able to support every kind of ORM ! ๐