mro
v0.0.93
Published
Map Relations to Objects - ORM but in reverse
Downloads
421
Maintainers
Readme
MRO
Model Relations to Objects
ORM but in reverse
Reads the schema of relational database (MySQL/PostgreSQL) 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.
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
- PostgreSQL
- SQLite
Support for other languages/frameworks
If there is interest this might be done in the future.