Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

nest.js 使用typeorm 连接mysql问题

连接数据库时 ,我把配置文件提出来了写在ormconfig.json里, 然后在app.module.ts里
TypeOrmModule.forRoot()就没传配置对象, 然后就报错,可是官方文档说可以这样, 大哥们给看看image
项目根目录创建的ormconfig.json
image
app.module.ts 里TypeOrmModule.forRoot()没传配置对象
image
就报错了, TypeOrmModule.forRoot()传配置对象可以,但是官方文档说可以把配置对象提出来到ormconfig.json里,这是怎么回事,带哥们给看看,为啥没有默认加载ormconfig.json里的配置


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...