From 20f19f3ec0580a03d366841c441186a06ace7044 Mon Sep 17 00:00:00 2001 From: transcaffeine Date: Sun, 2 Mar 2025 15:40:05 +0100 Subject: [PATCH] docs([tokio-]postgres/config): fix examples for unix socket paths The commonly used location for sockets is `/run/{service}`, with `/var/lib/{service}` containing the actual data from the service. --- postgres/src/config.rs | 6 +++--- tokio-postgres/src/config.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/postgres/src/config.rs b/postgres/src/config.rs index ae710d16b..d342be031 100644 --- a/postgres/src/config.rs +++ b/postgres/src/config.rs @@ -92,7 +92,7 @@ use tokio_postgres::{Error, Socket}; /// ``` /// /// ```not_rust -/// host=/var/lib/postgresql,localhost port=1234 user=postgres password='password with spaces' +/// host=/var/run/postgresql,localhost port=1234 user=postgres password='password with spaces' /// ``` /// /// ```not_rust @@ -117,7 +117,7 @@ use tokio_postgres::{Error, Socket}; /// ``` /// /// ```not_rust -/// postgresql://user:password@%2Fvar%2Flib%2Fpostgresql/mydb?connect_timeout=10 +/// postgresql://user:password@%2Fvar%2Frun%2Fpostgresql/mydb?connect_timeout=10 /// ``` /// /// ```not_rust @@ -125,7 +125,7 @@ use tokio_postgres::{Error, Socket}; /// ``` /// /// ```not_rust -/// postgresql:///mydb?user=user&host=/var/lib/postgresql +/// postgresql:///mydb?user=user&host=/var/run/postgresql /// ``` #[derive(Clone)] pub struct Config { diff --git a/tokio-postgres/src/config.rs b/tokio-postgres/src/config.rs index 7ba5638e3..dbaca2e79 100644 --- a/tokio-postgres/src/config.rs +++ b/tokio-postgres/src/config.rs @@ -178,7 +178,7 @@ pub enum Host { /// ``` /// /// ```not_rust -/// host=/var/lib/postgresql,localhost port=1234 user=postgres password='password with spaces' +/// host=/var/run/postgresql,localhost port=1234 user=postgres password='password with spaces' /// ``` /// /// ```not_rust @@ -203,7 +203,7 @@ pub enum Host { /// ``` /// /// ```not_rust -/// postgresql://user:password@%2Fvar%2Flib%2Fpostgresql/mydb?connect_timeout=10 +/// postgresql://user:password@%2Fvar%2Frun%2Fpostgresql/mydb?connect_timeout=10 /// ``` /// /// ```not_rust @@ -211,7 +211,7 @@ pub enum Host { /// ``` /// /// ```not_rust -/// postgresql:///mydb?user=user&host=/var/lib/postgresql +/// postgresql:///mydb?user=user&host=/var/run/postgresql /// ``` #[derive(Clone, PartialEq, Eq)] pub struct Config {