Generates entities for TypeORM from a databases.
Generates entities for TypeORM from a databases. Supports PostgreSQL engine only, but can be extend using Abstract driver. Inspired by https://github.com/Kononnable/typeorm-model-generator (unfortunately not supported anymore). The fork was created to add two main features: skip indices and relations generation.
- Add
toeg
to your project
npm i -D toeg
-
Then create a configuration file
.toeg.json
using.toeg-example.json
as a base. -
And finally run
toeg
:
node_modules/.bin/toeg
The generated entity models aren't formatted well, so it's recommended to run prettify and eslint on generated modules:
prettier --write --loglevel error \"output/*.ts\" && eslint \"output/*.ts\" --fix --quiet
Licensed under the MIT license.
Alexander Mac