如何将ElephantSQL与TypeORM连接?

问题描述 投票:0回答:1

在文档中只是显示与本地数据库的连接的示例:

'ormconfig.json'
{
   "type": "mysql",
   "host": "localhost",
   "port": 3306,
   "username": "test",
   "password": "test",
   "database": "test"
}

我想连接基于在线的ElephantSQL,但找不到解决方案。

sql database postgresql cloud typeorm
1个回答
0
投票

我能够连接,这是我的解决方案。

{
  "name": "default",
  "type": "postgres",
  "url": <URL>, 
  "synchronize": true,
  "logging": true,
  "entities": ["src/entity/*.*"]
}

URL是URL字符串,类似于“ postgres:// xxxxx:5432 / xxxx”

© www.soinside.com 2019 - 2024. All rights reserved.