@mikro-orm/nestjs 7.0.2-dev.18 → 7.0.2-dev.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,7 +55,18 @@ export class AppModule {}
|
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
The `forRoot()` method accepts the same configuration object as `init()` from the MikroORM package.
|
|
58
|
-
|
|
58
|
+
Since v7, the configuration must be provided explicitly — passing the options is required
|
|
59
|
+
(see the [v6 to v7 upgrading guide](https://mikro-orm.io/docs/upgrading-v6-to-v7#mikroorminit-requires-options-parameter)).
|
|
60
|
+
If you keep your config in a separate file (e.g. `mikro-orm.config.ts`), import it and pass it in:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import config from './mikro-orm.config';
|
|
64
|
+
|
|
65
|
+
@Module({
|
|
66
|
+
imports: [MikroOrmModule.forRoot(config)],
|
|
67
|
+
})
|
|
68
|
+
export class AppModule {}
|
|
69
|
+
```
|
|
59
70
|
|
|
60
71
|
Afterward, the `EntityManager` will be available to inject across entire project (without importing any module elsewhere).
|
|
61
72
|
|