当前位置:网站首页>记一个 @nestjs/typeorm^8.1.4 版本不能获取.env选项问题
记一个 @nestjs/typeorm^8.1.4 版本不能获取.env选项问题
2022-07-06 01:08:00 【crayon-shin-chan】
1.简介
在 typeorm 中,本可以通过 .env文件来配置连接选项
但是在升级到 @nestjs/typeorm^8.1.4 typeorm^0.3.7后,就去掉了这个功能
2.解决
可以使用 ConnectionOptionsReader 来解决
import { ConnectionOptionsReader } from 'typeorm/connection/ConnectionOptionsReader'
TypeOrmModule.forRootAsync({
useFactory: async () => {
const reader = new ConnectionOptionsReader();
const options = await reader.all()
return options[0]
}
})ConnectionOptionsReader 会在内部加载各种配置文件
边栏推荐
- [groovy] compile time meta programming (compile time method interception | method interception in myasttransformation visit method)
- vSphere实现虚拟机迁移
- [groovy] JSON string deserialization (use jsonslurper to deserialize JSON strings | construct related classes according to the map set)
- Distributed base theory
- 详细页返回列表保留原来滚动条所在位置
- ubantu 查看cudnn和cuda的版本
- China Taiwan strategy - Chapter 8: digital marketing assisted by China Taiwan
- SCM Chinese data distribution
- Arduino hexapod robot
- Dede collection plug-in free collection release push plug-in
猜你喜欢

BiShe - College Student Association Management System Based on SSM

Who knows how to modify the data type accuracy of the columns in the database table of Damon

Building core knowledge points

MCU realizes OTA online upgrade process through UART
![[pat (basic level) practice] - [simple mathematics] 1062 simplest fraction](/img/b4/3d46a33fa780e5fb32bbfe5ab26a7f.jpg)
[pat (basic level) practice] - [simple mathematics] 1062 simplest fraction

Exciting, 2022 open atom global open source summit registration is hot

Cf:c. the third problem

2020.2.13

95后CV工程师晒出工资单,狠补了这个,真香...
![[groovy] XML serialization (use markupbuilder to generate XML data | set XML tag content | set XML tag attributes)](/img/09/9076de099147b2d0696fe979a68ada.jpg)
[groovy] XML serialization (use markupbuilder to generate XML data | set XML tag content | set XML tag attributes)
随机推荐
2020.2.13
VSphere implements virtual machine migration
How to extract MP3 audio from MP4 video files?
FFT learning notes (I think it is detailed)
[Arduino syntax - structure]
Ubantu check cudnn and CUDA versions
The inconsistency between the versions of dynamic library and static library will lead to bugs
Live video source code, realize local storage of search history
Cve-2017-11882 reappearance
curlpost-php
Dede collection plug-in free collection release push plug-in
Cf:d. insert a progression [about the insert in the array + the nature of absolute value + greedy top-down]
Some features of ECMAScript
Five challenges of ads-npu chip architecture design
How to make your own robot
Keepalive component cache does not take effect
Xunrui CMS plug-in automatically collects fake original free plug-ins
Introduction to robotics I. spatial transformation (1) posture, transformation
I'm interested in watching Tiktok live beyond concert
[groovy] compile time metaprogramming (compile time method interception | find the method to be intercepted in the myasttransformation visit method)