我很新的web开发和更多的谷歌云,对任何事抱歉。我使用的是本地Postgre数据库(在我的应用程序中使用PostgreSQL),我在本地计算机上运行流畅,可以正常运行。但是,当我将它部署到Google Cloud时,它无法识别数据库(我在计算机引擎中创建了一个完全相同的海报数据库,并且使用了相同名称和凭据的Cloud SQL(Google Cloud的Postgre服务) ?),但同样,当应用程序是在云上,它不能识别的数据库,我错过了什么我应该怎么做与Postgre安装其他搬运工图像我如何部署一个完美的(迅速)后端代码+ PostgreSQL到谷歌应用引擎
这里是我的DBConnector代码:??
import PostgresStORM
func setupDBCredentials() -> PostgresConnector.Type{
let connection = PostgresConnector.self
connection.host = "localhost" // or the connection name of the Google Cloud, it doesn't work as well
connection.username = "postgres"
connection.password = "nearby"
connection.database = "nearby"
connection.port = 5432
return connection
}
基本上,我该如何让我的谷歌应用引擎代码连接到任何数据库?
另外,如果有帮助,我使用Perfect Assistant将我的代码部署到Google Cloud,使用Docker。
已经谢谢了!