Right way to use TypeOrm with NestJs

76 views Asked by At

I am new to nestjs, like have been using it for a month now. in learning I got to know there are mutiple orms and multiple techniques to communicate with database in NestJs.

for now I am using TypeOrm, in typeorm there are also multiple options how we can connect to database and do migrations. I have seen lot's of old codes of typeorm and nestjs and they were using ormconfig.js,ts.json, and in it for migrations there was cli option, however now in upgraded version it doesn't seem like it exist. I don't know what to use for database with typeorm.

today I just created new example of nestjs and typeorm which I found convenient to use. I don't know if it's right or wrong. please have look here: https://github.com/Codepire/nestjs-typeorm-example and suggest if anything is wrong. thank you.

I tried ormconfig to use cli options but TypeormModule.forRoot(ormconfig) not supporting cli options.

0

There are 0 answers