@midwayjs/mikro 3.4.7 → 3.4.11

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.
@@ -32,13 +32,15 @@ let MikroConfiguration = class MikroConfiguration {
32
32
  async onReady(container) {
33
33
  this.dataSourceManager = await container.getAsync(dataSourceManager_1.MikroDataSourceManager);
34
34
  const names = this.dataSourceManager.getDataSourceNames();
35
- if (names.length === 1) {
36
- // 多个的话,不知道用哪个数据源,所以这里无法判断出来
35
+ const entityManagers = names.map(name => {
36
+ return this.dataSourceManager.getDataSource(name).em;
37
+ });
38
+ if (names.length > 0) {
37
39
  // create mikro request scope
38
40
  // https://mikro-orm.io/docs/identity-map
39
41
  this.applicationManager.getApplications().forEach(app => {
40
42
  app.useMiddleware(async (ctx, next) => {
41
- return await core_2.RequestContext.createAsync(this.dataSourceManager.getDataSource(names[0]).em, next);
43
+ return await core_2.RequestContext.createAsync(entityManagers, next);
42
44
  });
43
45
  });
44
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/mikro",
3
- "version": "3.4.7",
3
+ "version": "3.4.11",
4
4
  "main": "dist/index",
5
5
  "typings": "index.d.ts",
6
6
  "files": [
@@ -9,21 +9,21 @@
9
9
  "index.d.ts"
10
10
  ],
11
11
  "devDependencies": {
12
- "@midwayjs/core": "^3.4.7",
13
- "@midwayjs/decorator": "^3.4.4",
14
- "@midwayjs/mock": "^3.4.7",
15
- "@mikro-orm/core": "5.2.4",
16
- "@mikro-orm/entity-generator": "5.2.4",
12
+ "@midwayjs/core": "^3.4.11",
13
+ "@midwayjs/decorator": "^3.4.11",
14
+ "@midwayjs/mock": "^3.4.11",
15
+ "@mikro-orm/core": "5.3.1",
16
+ "@mikro-orm/entity-generator": "5.3.1",
17
17
  "@mikro-orm/sql-highlighter": "1.0.1",
18
- "@mikro-orm/sqlite": "5.2.4",
19
- "sqlite3": "5.0.10"
18
+ "@mikro-orm/sqlite": "5.3.1",
19
+ "sqlite3": "5.0.11"
20
20
  },
21
21
  "author": {
22
22
  "name": "czy88840616",
23
23
  "email": "czy88840616@gmail.com"
24
24
  },
25
25
  "engines": {
26
- "node": ">=15.14.0"
26
+ "node": ">=14.0.0"
27
27
  },
28
28
  "license": "MIT",
29
29
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "type": "git",
36
36
  "url": "http://github.com/midwayjs/midway.git"
37
37
  },
38
- "gitHead": "3c60619a65c6776d99fbf0b30ac454d3cb6926b9"
38
+ "gitHead": "942dd076d60f27d6004640fa6dd9a9724efc559d"
39
39
  }