首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >nestjs typrorm @onetoone 在 mssql中报错?

nestjs typrorm @onetoone 在 mssql中报错?

提问于 2023-03-20 11:53:16
回答 0关注 0查看 108

我在mssql 创建了 两个表 user profile

当我使用 单表查询时

数据是可以正常显示的

但是我将 relations 启用 就会报

这里的userID 是typrorm 自动生成的 使用 @onetoone 就会这样

但是mssql 报错了

//?synchronize:?true, 我注释了

TypeOrmModule.forRoot({

type: 'mssql',

host: '127.0.0.1',

port: 1433,

username: 'sa',

password: '123456',

database: 'master',

entities:?["dist/**/*.entity{.ts,.js}"],

//?同步本地的schema与数据库?->?初始化的时候去使用

//?synchronize:?true,

logging: true,

//?logging:?['error'],

options:?{

"encrypt": false //?Windows?Azure时设置为true,其他设置为false

??????},

extra:?{

trustServerCertificate: true,

trustedConnection: true,

??????}

????}),

回答

和开发者交流更多问题细节吧,去?写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com