1#[cfg(feature = "replication")]
13pub mod replication;
14#[cfg(feature = "replication")]
15pub use replication::{
16 available_replication_slots, drop_replication_slots, get_current_wal_lsn, get_max_wal_senders,
17 get_timeline_id, get_wal_level,
18};
19#[cfg(feature = "schemas")]
20pub mod desc;
21#[cfg(feature = "schemas")]
22pub mod schemas;
23#[cfg(feature = "schemas")]
24pub use schemas::{get_schemas, publication_info};
25#[cfg(feature = "tunnel")]
26pub mod tunnel;
27#[cfg(feature = "tunnel")]
28pub use tunnel::{Client, Config, DEFAULT_SNAPSHOT_STATEMENT_TIMEOUT, TunnelConfig};
29
30pub mod query;
31pub use query::simple_query_opt;
32
33#[derive(Debug, thiserror::Error)]
35pub enum PostgresError {
36 #[error(transparent)]
38 Generic(#[from] anyhow::Error),
39 #[cfg(feature = "tunnel")]
41 #[error("error setting up ssh: {0}")]
42 Ssh(#[source] anyhow::Error),
43 #[error("error communicating with ssh tunnel: {0}")]
45 SshIo(std::io::Error),
46 #[error("IO error in connection: {0}")]
48 Io(#[from] std::io::Error),
49 #[error(transparent)]
51 Postgres(#[from] tokio_postgres::Error),
52 #[error(transparent)]
54 PostgresSsl(#[from] openssl::error::ErrorStack),
55 #[error("query returned more rows than expected")]
56 UnexpectedRow,
57 #[error("publication {0} does not exist")]
62 PublicationMissing(String),
63}