2024-03-01 08:07:49 -08:00
|
|
|
use crate::env_helper::string_or_env;
|
2024-02-29 08:05:29 -08:00
|
|
|
use serde::Deserialize;
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Deserialize, Default)]
|
|
|
|
pub struct PostgresConfiguration {
|
2024-03-01 08:07:49 -08:00
|
|
|
#[serde(deserialize_with = "string_or_env")]
|
2024-02-29 08:05:29 -08:00
|
|
|
pub connection_string: String,
|
|
|
|
pub allow_invalid_certs: bool,
|
|
|
|
pub tls: Option<PostgresTlsConfig>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Deserialize)]
|
|
|
|
pub struct PostgresTlsConfig {
|
|
|
|
/// CA Cert file or env var
|
|
|
|
pub ca_cert_path: String,
|
|
|
|
/// PKCS12 client cert path
|
|
|
|
pub client_key_path: String,
|
|
|
|
}
|