0.0.3 • Published 1 year ago

objection-model-reverse v0.0.3

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

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