From 31ed42018693e118d51af82b4372488646a96c1b Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Sun, 26 Apr 2026 15:36:13 +0800 Subject: [PATCH] fix(db): disable sqlx check_compatibility for non-standard PostgreSQL servers Cloud-managed PostgreSQL variants (PolarDB, CockroachDB, etc.) may not return a standard version string, causing: "Failed to obtain server version. Unable to check client-server compatibility." Setting check_compatibility(false) on both writer and reader connections silences this harmless warning. --- libs/db/database.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/db/database.rs b/libs/db/database.rs index b965878..5e9ea96 100644 --- a/libs/db/database.rs +++ b/libs/db/database.rs @@ -31,6 +31,7 @@ impl AppDatabase { .connect_timeout(Duration::from_secs(connection_timeout)) .set_schema_search_path(schema_search_path) .sqlx_logging(false) + .check_compatibility(false) .to_owned(); let db_write = Database::connect(conn_cfg).await?; @@ -42,6 +43,7 @@ impl AppDatabase { .idle_timeout(Duration::from_secs(idle_timeout)) .max_lifetime(Duration::from_secs(max_lifetime)) .connect_timeout(Duration::from_secs(connection_timeout)) + .check_compatibility(false) .to_owned(); Some(Database::connect(conn_cfg).await?)