Skip to content

Commit abc4b3a

Browse files
fix: make lib compatible with TypeDI 0.9.0+
1 parent 5d693ab commit abc4b3a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
import { Container } from 'typedi';
2+
import { ConnectionManager } from 'typeorm';
3+
4+
/**
5+
* We need to set imported TypeORM classes before requesting them, otherwise we
6+
* would receive a "ServiceNotFoundError" above TypeDI 0.9.1.
7+
*/
8+
Container.set({ id: ConnectionManager, type: ConnectionManager });
9+
110
export * from './decorators/InjectConnection';
211
export * from './decorators/InjectManager';
312
export * from './decorators/InjectRepository';

0 commit comments

Comments
 (0)