mro

0.0.87 • Public • Published

MRO

Model Relations to Objects

ORM but in reverse

Reads the schema of relational databases and outputs to objects in JSON or Javascript.

Why

  • You want to quickly generate a JSON overview of your database.

  • You want to create HTML docs for your database.

  • You want to backup your database schema and version them.

  • You prefer to define your database with SQL syntax.

  • You already have an existing database and don't want to spend additional time remodelling it in your ORM.

  • If you aren't sure how to define migrations on certain column types in Knex.js

  • If you aren't sure how to model your objects in Objection.js.

  • Why not just try it for fun. It's really easy to use.

How to use

$ npx mro

And follow the prompts. Should be pretty straightforward. If something isn't then create an issue.

Just run it where you want the file(s) to be output to.

Cli Example

Supported formats

Examples are based on the example schema

JSON:

Check out the JSON example output file

Knex.js:

Check out the Knex migration example output file Learn More

Objection.js:

Check out the Objection examples models folder Learn More

Create an issue

  • If you experience bugs
  • If you have feature requests
  • If you have general comments/feedback

Supported Databases

  • MySQL

Support for other languages/frameworks

If there is interest this might be done in the future.

Package Sidebar

Install

npm i mro

Weekly Downloads

10

Version

0.0.87

License

MIT

Unpacked Size

103 kB

Total Files

20

Last publish

Collaborators

  • andl