Skip to content

Commit

Permalink
feat: allow adding extraProviders when the module is loaded asynchron…
Browse files Browse the repository at this point in the history
…ously
  • Loading branch information
jevillard committed Apr 7, 2022
1 parent 33cbae4 commit c44b6bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/interfaces/typeorm-options.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ModuleMetadata, Type } from '@nestjs/common';
import {ModuleMetadata, Provider, Type} from '@nestjs/common';
import { Connection, ConnectionOptions } from 'typeorm';

export type TypeOrmModuleOptions = {
Expand Down Expand Up @@ -54,4 +54,5 @@ export interface TypeOrmModuleAsyncOptions
) => Promise<TypeOrmModuleOptions> | TypeOrmModuleOptions;
connectionFactory?: TypeOrmConnectionFactory;
inject?: any[];
extraProviders?: Provider[];
}
1 change: 1 addition & 0 deletions lib/typeorm-core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class TypeOrmCoreModule implements OnApplicationShutdown {
provide: TYPEORM_MODULE_ID,
useValue: generateString(),
},
...(options.extraProviders || []),
],
exports: [entityManagerProvider, connectionProvider],
};
Expand Down

0 comments on commit c44b6bc

Please sign in to comment.