Skip to main content

faucet_common_redshift/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! # faucet-common-redshift
4//!
5//! Shared connection, credentials, and connection-pool types for the
6//! [`faucet-stream`](https://crates.io/crates/faucet-stream) Amazon Redshift
7//! source and sink connectors.
8//!
9//! Redshift is wire-compatible with PostgreSQL, so both connectors talk to it
10//! through `sqlx`'s Postgres driver.
11//!
12//! - [`RedshiftCredentials`] — `password` (implemented in v1), plus reserved
13//!   `iam` / `redshift_data_api` variants that currently return a typed error.
14//! - [`RedshiftConnection`] — host / port / database / user + a TLS toggle;
15//!   flattened into both end configs so the wire shape matches the other SQL
16//!   connectors.
17//! - [`build_connect_options`] / [`build_pool`] / [`build_pool_lazy`] — the
18//!   single place a `sqlx` [`PgConnectOptions`](sqlx::postgres::PgConnectOptions)
19//!   and a [`PgPool`](sqlx::PgPool) are constructed.
20//! - [`resolve_password`] — extracts the password (and is where an unsupported
21//!   credential variant surfaces its error).
22
23mod config;
24mod pool;
25
26pub use config::{DEFAULT_PORT, RedshiftConnection, RedshiftCredentials};
27pub use pool::{build_connect_options, build_pool, build_pool_lazy, resolve_password};