Crud too many management page projects, EASYCODE with nodejs access to the database ability, one click to let you generate code
GitHub download and use
Compiling and running
Without XXX, this step is very difficult to succeed
Connect to database
Using shortcut keys
ctrl+nOr through the menu button
Connection > connect to the database
Fill in the corresponding information, check the box, and you won’t have to fill in the form next time you come in.
Select crud information
As shown in the figure, after filling in the data name and table name, the information of the table will be found.
insertRepresents the display field when a new form is added
searchRepresents the field displayed when searching for a query
queryRepresents the fields displayed in the table table
There are preset EJS templates, or you can choose your own EJS templates.
generateButton, code generated successfully.
Open with vscodeYou can see that the code has been generated!
How to customize a template
I have injected some variables into EJS:
Insertlist: array < field > // new field collection Querylist: array < field > // query field collection Searchlist: array < field > // search field collection Suffix: string // suffix // Name: templatename A kind of : Object // lodash object, you can use lodash in EJS!!
The field information is as follows:
Collation: string, Comment: string, // comment Default: string, // default value Field: string, // field name Key: string, // key name Null: string, // can be null Privileges: string, // permissions Type: string // type
In theory, as long as it can be generated according to the database, it can be generated!
Make good use of it
lodashCan complete any code, whether later
angularAfter all, the logic is written in EJS template
Data is dead, templates are alive
JavaAfter the automatic generation of the back-end language, it will follow.
- Multi database, dialect ability must be added
Please let me know if you encounter any uncomfortable points in the process of usinghttps://github.com/chendonmin…