在NodeJS(NestJS)中,我使用TypeORM连接到数据库(Oracle)。我希望在应用程序运行期间传递用户名和密码。由于安全原因,在我的公司中,安全设置是针对每个用户创建一个数据库模式。他使用他的DB凭据登录应用程序。我知道这不是业界非常流行的做法。
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和Node.js/NestJs上实现这个的参考/提示吗?
谢谢。
await
在返回对象之前在useFactory回调上是否可以/推荐使用? - Alejandro Barone