@mikro-orm/nestjs 7.0.0 → 7.0.1-dev.1

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.
@@ -84,6 +84,10 @@ let MikroOrmCoreModule = MikroOrmCoreModule_1 = class MikroOrmCoreModule {
84
84
  if (typeof options === 'object' && options && 'driver' in options && !('useFactory' in options)) {
85
85
  config = new Configuration(options, false);
86
86
  }
87
+ // For async options with explicit driver hint, create a minimal config for EM type detection
88
+ if (!config && 'driver' in options && options.driver) {
89
+ config = new Configuration({ driver: options.driver }, false);
90
+ }
87
91
  if (!config && 'useFactory' in options) {
88
92
  config = new Configuration(await options.useFactory(), false);
89
93
  }
@@ -81,7 +81,9 @@ export function createMikroOrmRepositoryProviders(entities, contextName) {
81
81
  const providers = [];
82
82
  const inject = contextName ? getEntityManagerToken(contextName) : EntityManager;
83
83
  (entities || []).forEach(entity => {
84
- const meta = entity instanceof EntitySchema ? entity.meta : metadata.find(meta => meta.class === entity);
84
+ const meta = entity instanceof EntitySchema
85
+ ? entity.meta
86
+ : (typeof entity === 'function' ? EntitySchema.REGISTRY.get(entity)?.meta : undefined) ?? metadata.find(meta => meta.class === entity);
85
87
  const repository = meta?.repository;
86
88
  if (repository) {
87
89
  providers.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/nestjs",
3
- "version": "7.0.0",
3
+ "version": "7.0.1-dev.1",
4
4
  "description": "NestJS module for MikroORM",
5
5
  "keywords": [
6
6
  "data-mapper",