faucet-common-redshift
Shared connection, credentials, and connection-pool types for the
faucet-stream Amazon Redshift
source (faucet-source-redshift) and sink (faucet-sink-redshift)
connectors.
Redshift speaks the PostgreSQL wire protocol, so both connectors connect through
sqlx's Postgres driver. This crate centralises that so TLS, auth, and pooling
behave identically on both sides.
Types
RedshiftCredentials— adjacently-tagged{ type, config }enum:password— username/password auth (the user comes from the connection block). The only mechanism implemented in v1.iam/redshift_data_api— reserved for a future release; building a client with either currently returns a typedFaucetError::Config.
RedshiftConnection—host,port(default5439),database,user,credentials, atlstoggle (defaulttrue), and the optionaltls_mode(disable|prefer|require|verify_ca|verify_full, overridestls) +ssl_root_cert(CA PEM path for the verifying modes; without it they verify against the Mozilla root store bundled into the binary, not the operating system's). Flattened into both end configs.
Helpers
build_connect_options(&RedshiftConnection)— purePgConnectOptionsbuilder.tls: true→sslmode=require(encrypted, certificate not verified);tls: false→sslmode=prefer. Settls_mode: verify_fullwithssl_root_cert(the Redshift CA bundle) to verify the server certificate and host name;ssl_root_certwith a non-verifying mode is a config error.build_pool_lazy(conn, max)— lazily-connected pool (no I/O at construction).build_pool(conn, max)— eagerly validated pool (fails fast on bad creds).resolve_password(&RedshiftCredentials)— extracts the password.
Example
host: my-cluster.abc123.us-east-1.redshift.amazonaws.com
port: 5439
database: dev
user: admin
credentials:
type: password
config:
password: ${env:REDSHIFT_PASSWORD}
tls_mode: verify_full
ssl_root_cert: /etc/ssl/redshift-ca-bundle.crt
License: MIT OR Apache-2.0