#[cfg(feature = "replication")]
pub mod replication;
#[cfg(feature = "replication")]
pub use replication::{
available_replication_slots, drop_replication_slots, get_current_wal_lsn, get_max_wal_senders,
get_timeline_id, get_wal_level,
};
#[cfg(feature = "schemas")]
pub mod desc;
#[cfg(feature = "schemas")]
pub mod schemas;
#[cfg(feature = "schemas")]
pub use schemas::{get_schemas, publication_info};
#[cfg(feature = "tunnel")]
pub mod tunnel;
#[cfg(feature = "tunnel")]
pub use tunnel::{Client, Config, TunnelConfig, DEFAULT_SNAPSHOT_STATEMENT_TIMEOUT};
pub mod query;
pub use query::simple_query_opt;
#[derive(Debug, thiserror::Error)]
pub enum PostgresError {
#[error(transparent)]
Generic(#[from] anyhow::Error),
#[cfg(feature = "tunnel")]
#[error("error setting up ssh: {0}")]
Ssh(#[source] anyhow::Error),
#[error("error communicating with ssh tunnel: {0}")]
SshIo(std::io::Error),
#[error("IO error in connection: {0}")]
Io(#[from] std::io::Error),
#[error(transparent)]
Postgres(#[from] tokio_postgres::Error),
#[error(transparent)]
PostgresSsl(#[from] openssl::error::ErrorStack),
#[error("query returned more rows than expected")]
UnexpectedRow,
#[error("publication {0} does not exist")]
PublicationMissing(String),
}