Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Optimize typeorm to initialize loading entities #1150

Merged
merged 4 commits into from Jul 14, 2021

Conversation

zkamisama
Copy link
Contributor

@zkamisama zkamisama commented Jul 13, 2021

  • 修复 typeorm 配置多数据库时, 初始化加载全部实体问题
  • 新增 EntityModel装饰器 新增一个connectionName 参数 指定哪个配置加载该实体
Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

* 修复 typeorm 配置多数据库时, 初始化加载全部实体问题
* 新增 EntityModel装饰器 新增一个connectionName 参数 指定哪个配置加载该实体
@gitpod-io
Copy link

gitpod-io bot commented Jul 13, 2021

* 修复类型提示
* 修复默认加载所有实体
* fix lint error
@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2021

Codecov Report

Merging #1150 (f3f3938) into 2.x (f4f7a55) will decrease coverage by 0.00%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x    #1150      +/-   ##
==========================================
- Coverage   85.60%   85.59%   -0.01%     
==========================================
  Files         221      221              
  Lines        8808     8824      +16     
  Branches     1748     1752       +4     
==========================================
+ Hits         7540     7553      +13     
- Misses       1206     1209       +3     
  Partials       62       62              
Impacted Files Coverage Δ
packages/orm/src/index.ts 70.37% <87.50%> (+1.74%) ⬆️
packages/orm/src/configuration.ts 98.00% <92.85%> (-0.89%) ⬇️
packages/core/src/context/requestContainer.ts 96.66% <0.00%> (-3.34%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4f7a55...f3f3938. Read the comment docs.

@kurten
Copy link
Contributor

kurten commented Jul 14, 2021

缺少测试 case,是否可以加一下呢?

@zkamisama
Copy link
Contributor Author

缺少测试 case,是否可以加一下呢?

已加

@czy88840616 czy88840616 changed the title 优化 typeorm初始化加载实体 feat: Optimize typeorm to initialize loading entities Jul 14, 2021
@czy88840616 czy88840616 merged commit f0faf2f into midwayjs:2.x Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants