#Provide dataSource CLI parameter when using useFactory

2 messages · Page 1 of 1 (latest)

mild hawk
#

Hello. I am trying to integrate nestjs/typeorm into my nest project.

And I configure TypeOrmModule using useFactory with config service provided. Now I want to generate migration, and for that typeorm requires to provide data source path. Google tells me that new DataSource({... declaration should be placed somewhere and -d param should lead to this file.

But obviously in my project something similar to data source object is placed into function.

So the question, is how to specify this path, when there is no explicit declaration of data source in my project?

narrow dew
#

Hang on, someone made a package integrating #1058054786060124201 with @nestjs/typeorm so you could use a Nest module for typeorm CLI commands