postgresql-schema-upgrader 0.1.2

A robust, safety-first library for managing PostgreSQL database schema migrations with both sync and async support.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::UpgraderError;

#[cfg(feature = "tls")]
pub fn create_tls_config() -> Result<tokio_postgres_rustls::MakeRustlsConnect, UpgraderError> {
    use rustls::ClientConfig;

    let root_store =
        rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());

    let config = ClientConfig::builder()
        .with_root_certificates(root_store)
        .with_no_client_auth();

    Ok(tokio_postgres_rustls::MakeRustlsConnect::new(config))
}