fix: PgConnectOptions docs (#3809)

This commit is contained in:
Markus Schirp 2025-04-14 00:21:15 +00:00 committed by GitHub
parent 97bf270caf
commit 154878547e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -134,6 +134,19 @@ impl PgConnectOptions {
/// # use sqlx_postgres::PgConnectOptions;
/// let options = PgConnectOptions::new();
/// ```
///
/// Note: that unlike `libpq` the environment variables:
///
/// * `PGSSLROOTCERT`
/// * `PGSSLCERT`
/// * `PGSSLKEY`
///
/// Must not exclusively be path, ´sqlx-postgres` supports these variables
/// encode the certificates / keys directly. Content snooping is done via
/// `CertificateInput::from`.
///
/// Note: Putting key material in environment variables can be subjected to risk as on
/// some platforms environment variables can be recovered by other (non root) users.
pub fn new() -> Self {
Self::new_without_pgpass().apply_pgpass()
}