diff --git a/backend/windmill-common/src/lib.rs b/backend/windmill-common/src/lib.rs index ee9c25a3e5..db8b5916cf 100644 --- a/backend/windmill-common/src/lib.rs +++ b/backend/windmill-common/src/lib.rs @@ -404,30 +404,6 @@ impl PgDatabase { ) } - pub fn to_conn_str(&self) -> String { - format!( - "dbname={dbname} {user} host={host} {password} {port} {sslmode}", - dbname = self.dbname, - user = self - .user - .as_ref() - .map(|u| format!("user={}", urlencoding::encode(u))) - .unwrap_or_default(), - host = self.host, - password = self - .password - .as_ref() - .map(|p| format!("password={}", urlencoding::encode(p))) - .unwrap_or_default(), - port = self.port.map(|p| format!("port={}", p)).unwrap_or_default(), - sslmode = self - .sslmode - .as_ref() - .map(|s| format!("sslmode={}", s.clone())) - .unwrap_or_default(), - ) - } - pub async fn connect( &self, ) -> Result<(tokio_postgres::Client, TokioPgConnection), error::Error> { diff --git a/backend/windmill-worker/src/duckdb_executor.rs b/backend/windmill-worker/src/duckdb_executor.rs index 8345cbd7c2..f5a13d13ba 100644 --- a/backend/windmill-worker/src/duckdb_executor.rs +++ b/backend/windmill-worker/src/duckdb_executor.rs @@ -10,8 +10,6 @@ use serde_json::value::RawValue; use serde_json::{json, Value}; use uuid::Uuid; use windmill_common::error::{to_anyhow, Error, Result}; -use windmill_types::s3::S3Object; -use windmill_object_store::S3_PROXY_LAST_ERRORS_CACHE; use windmill_common::utils::sanitize_string_from_password; use windmill_common::worker::{Connection, SqlResultCollectionStrategy}; use windmill_common::workspaces::{ @@ -19,8 +17,10 @@ use windmill_common::workspaces::{ DucklakeCatalogResourceType, }; use windmill_common::PgDatabase; +use windmill_object_store::S3_PROXY_LAST_ERRORS_CACHE; use windmill_parser_sql::{parse_duckdb_sig, parse_sql_blocks}; use windmill_queue::{CanceledBy, MiniPulledJob}; +use windmill_types::s3::S3Object; use crate::agent_workers::{get_datatable_resource_from_agent_http, get_ducklake_from_agent_http}; use crate::common::{build_args_values, get_reserved_variables, OccupancyMetrics}; @@ -419,7 +419,7 @@ fn format_attach_db_conn_str(db_resource: Value, db_type: &str) -> Result { let res: PgDatabase = serde_json::from_value(db_resource)?; - res.to_conn_str() + res.to_uri() } #[cfg(feature = "mysql")] "mysql" => {