Tom*_*asz 1 sql database cloud postgresql typeorm
文档中仅显示与本地数据库连接的示例:
'ormconfig.json'
{
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "test",
"password": "test",
"database": "test"
}
Run Code Online (Sandbox Code Playgroud)
我想连接基于在线的 ElephantSQL,但找不到解决方案。
小智 5
我能够连接,这是我的解决方案。
{
"name": "default",
"type": "postgres",
"url": <URL>,
"synchronize": true,
"logging": true,
"entities": ["src/entity/*.*"]
}
Run Code Online (Sandbox Code Playgroud)
URL 是类似于“postgres://xxxxx:5432/xxxx”的 url 字符串