Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] - Custom generator #414

Closed
foyarash opened this issue Sep 12, 2024 · 2 comments
Closed

[FEATURE] - Custom generator #414

foyarash opened this issue Sep 12, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@foyarash
Copy link
Collaborator

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

@foyarash foyarash added the enhancement New feature or request label Sep 12, 2024
@FacundoSpira
Copy link
Contributor

Really like this idea! If the DMMF is eventually deprecated, this can allow in the future to support different ORMs, for example Drizzle 👀

@foyarash
Copy link
Collaborator Author

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 ! 😄

@foyarash foyarash self-assigned this Sep 27, 2024
@foyarash foyarash mentioned this issue Sep 30, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants