Version: 4.4
Entity Generator
To generate entities from existing database schema, you can use EntityGenerator
helper.
You can use it via CLI:
Or you can create simple script where you initialize MikroORM like this:
./generate-entities.ts
Then run this script via ts-node
(or compile it to plain JS and use node
):
#
Current limitations- many to many relations are not supported, pivot table will be represented as separate entity
- in mysql, tinyint columns will be defined as boolean properties