【发布时间】:2020-06-02 19:21:50
【问题描述】:
在 NodeJS (NestJS) 上,我使用 TypeORM 连接到数据库 (Oracle)。我想在应用程序运行时传递用户名和密码。
出于安全原因,在我的公司中,安全性配置为为每个用户创建一个数据库模式。他使用他的数据库凭证登录到应用程序。我知道这在业界不是很流行的做法。
const connection = await createConnection({
type: "oracle",
host: "localhost",
port: 3306,
username: "test", // this need to pass during run time
password: "test", // same thing for the password
database: "test"
});
您能否与我分享有关如何在 typeORM 和 nodeJs/NestJs 上实现此目标的任何参考/提示?
谢谢
【问题讨论】:
标签: node.js oracle nestjs typeorm