繁体   English   中英

如何将 ElephantSQL 与 TypeORM 连接?

[英]How to connect ElephantSQL with TypeORM?

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

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

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

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM