我正在尝试使用Diesel连接到ElephantSQL(云托管)数据库。我有要构建的项目,但是在尝试运行时出现此错误:
thread 'main' panicked at 'Error connecting to postgres://username:password@raja.db.elephantsql.com:5432/t/username: BadConnection("could not connect to server: Connection refused (0x0000274D/10061)\n\tIs the server running on host \"raja.db.elephantsql.com\" (52.23.183.171) and accepting\n\tTCP/IP connections on port 5432?\n")', src\libcore\result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: process didn't exit successfully: `target\debug\main.exe` (exit code: 101)
我的Diesel项目基本上看起来像the one in the "getting started" guide,但我没有使用Diesel CLI(因此没有迁移文件夹)。
我使用的URL由ElephantSQL提供:
postgres://username:password@raja.db.elephantsql.com:5432/t/username