Open CatsMiaow opened 4 years ago
It should be easy to implemented, but I'm not sure about the design(in general). Lately we've been adding more and more options to customize generated models. The list of command parameters is getting longer and longer and I don't really like where this is going(but didn't find a better solution yet).
It's a bit hacky way, but actually you can achieve this right now. Just add a coma after db name -d db1,
. Alternatively you can specify db which does not exits. This way library will thin that results might be from different databases and will generate database attribute.
I think it would be nice to have a configuration file like ormconfig.json
or tsconfig.json
if you have a lot of parameters.
typeorm-model-generator --noConfig --ce pascal -h host -p port -d database -u username -x password -e mysql -o entity ...
typeorm-model-generator -c config.path.json
You can run typeorm-model-generator
without passing any parameters. You'll enter wizard mode which will offer to save setting to configuration file.
I'm using multiple database. db1, db2, db3 ...
-d db1
does not add the database attribute.https://github.com/Kononnable/typeorm-model-generator/blob/master/src/drivers/AbstractDriver.ts#L208
multiple databases require
,
-d db1,db2,db3
This adds the database properties but outputs all the files in one place. I want to create a folder for each database and specify the folder name when importing entities.I think it would be nice to have the option of forcibly adding a database attribute even if you enter a single db(
-d db1
).