objection-model-reverse
v0.0.3
Published
Generate all ObjectionJS models from Mysql in separate files (As Propel in PHP)
Downloads
7
Maintainers
Readme
About
Objection Model Reverse is a tool to automagically generate all ObjectionJS models from Mysql data base, using the information_schema table to let us know tables, columns and BelongsToOneRelation. It works like Propel ORM (PHP): On target folder generates classes representing DB entities. You should write your business-logic there. Each file is derived from another base class. You must not modify the files in base directory.
Install package and dependencies
npm i -S ajv-formats knex objection
npm i -D objection-model-reverse
Add to package.json:
{
"scripts": {
...
"db:revese": "propel-objection-cli"
}
}
Run
> npm run db:reverse