#typeorm two databases

2 messages · Page 1 of 1 (latest)

outer leaf
#

I'm trying to connect to two databases via typeorm, according to the nestJS documentation I have to give add a name in ForRoot.
With the name I'm getting a Nest can't resolve dependencies of the KeyRepository error, even without ever using it.

Here is my app.module for typeorm: @Module({ imports: [DatabaseModule, TypeOrmModule.forRoot({ name: 'asddd', type: 'sqlite', database: './data/local_db.sqlite', synchronize: true, entities: ['dist/**/*.entity.js'], }), TypeOrmModule.forFeature([Key]) ],
Without the name: it compiles without any errors. Help would be appriciated.

Edit: I'm testing the config with a single DB currently

prime kelp
#

When you add the name, are you also adding the name to the forFeature and @InjectRepository()?