Allow usage of the compute hostname in the proxy

This commit is contained in:
Alexey Kondratov
2021-10-01 15:14:42 +03:00
committed by Alexey Kondratov
parent cf8e27a554
commit 2c99e2461a
2 changed files with 11 additions and 6 deletions

View File

@@ -248,7 +248,7 @@ databases without opening the browser.
/// Create a TCP connection to a postgres database, authenticate with it, and receive the ReadyForQuery message
async fn connect_to_db(db_info: DatabaseInfo) -> anyhow::Result<tokio::net::TcpStream> {
let mut socket = tokio::net::TcpStream::connect(db_info.socket_addr()).await?;
let mut socket = tokio::net::TcpStream::connect(db_info.socket_addr()?).await?;
let config = db_info.conn_string().parse::<tokio_postgres::Config>()?;
let _ = config.connect_raw(&mut socket, NoTls).await?;
Ok(socket)