pub struct PgwireConfig {
pub enabled: bool,
pub listen: IpAddr,
pub port: u16,
pub username: String,
pub password: Option<String>,
pub tls_cert: Option<PathBuf>,
pub tls_key: Option<PathBuf>,
}Expand description
Experimental PostgreSQL wire-protocol server ([server.pgwire] block).
When enabled on the DataFusion backend, BI tools (Power BI via Npgsql,
psql, DBeaver, …) can connect and query the registered datasets as if
this process were PostgreSQL. Off by default and a no-op unless the binary
was built with the pgwire feature on datapress-datafusion.
Fields§
§enabled: boolStart the pgwire listener after datasets are registered.
listen: IpAddrListen address. Defaults to loopback (127.0.0.1). Binding a non-loopback address requires a password (and, since only cleartext password auth is available, TLS as well).
port: u16TCP port. Defaults to the PostgreSQL default 5432.
username: StringUsername clients must present. Defaults to datapress.
password: Option<String>Password clients must present. Optional only for a loopback-only listener; required for any non-loopback bind.
tls_cert: Option<PathBuf>PEM certificate path for TLS. Must be set together with tls_key.
tls_key: Option<PathBuf>PKCS#8 private-key path for TLS. Must be set together with tls_cert.
Implementations§
Source§impl PgwireConfig
impl PgwireConfig
Sourcepub fn validate_enabled(&self) -> Result<(), AppError>
pub fn validate_enabled(&self) -> Result<(), AppError>
Validate the enabled pgwire configuration. Because the only available authentication mechanism is cleartext password (SCRAM would need a salted verifier the integration library does not expose), the rules are deliberately strict about exposing an off-box listener:
- a non-loopback
listenrequires apassword— an unauthenticated SQL endpoint must never be reachable off the local host; tls_certandtls_keymust be set together or not at all;- a non-loopback
listenalso requires TLS, so the cleartext password never crosses a plaintext TCP connection off the box.
Trait Implementations§
Source§impl Clone for PgwireConfig
impl Clone for PgwireConfig
Source§fn clone(&self) -> PgwireConfig
fn clone(&self) -> PgwireConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more