-
Notifications
You must be signed in to change notification settings - Fork 73
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
Code generation from database schema #58
Comments
@HamedMasafi FYI I have put together a tool which is capable of generating the Nut ORM classes from a MySQL schema: I am still polishing it, at the moment it generates code which compiles. It is just a heads up, it is still rough (no test for e.g.) but I think if it would be extended to the non MySQL databases then it would add a lot to the Nut's traits. |
Hi @martonmiklos I also saw your new project But I also have one suggestion: Make this project part of a nut. In fact, a class like SchemaGenerator creates a Nut :: DatabaseModel from a database. He can then be added to the CodeGenerator class and provided with the library for a code generation tool. If you agree with the idea, we can do it |
Hi @HamedMasafi I am still on the steep phase of the learning curve with Nut, but I am starting to discover it's capabilities. I am glad that you would like to see that you are open for merging it to the Nut. I will work on integrating it to the Nut: I will create some CI tests before submitting PR. What I see now in general that the Nut wants to generate the tables from the code, what might be useful to make disable-able in the case of autogenerated database/table classes. |
Hi @HamedMasafi
First of all thank you for your great work, I am not using it yet, but it looks very promising!
I was wondering if it would be useful to create a code generator which would generate the database/table code automatically from a given database schema.
I am thinking about something similar what is called scaffolding in CakePHP (more exactly only the model generation of that).
The table connections (hasMany, belongsTo in CakePHP terminology) could be detected by detecting the naming convention of the fields (if post table has an user_id key then post belongsTo User).
If you like this idea I can work on it and submit a PR or we can develop this tool even in a separate repository.
Thanks in advance and happy new year!
The text was updated successfully, but these errors were encountered: