sqlx_build_trust_postgres/
lib.rs

1//! **PostgreSQL** database driver.
2
3#[macro_use]
4extern crate sqlx_build_trust_core as sqlx_core;
5
6use crate::executor::Executor;
7
8mod advisory_lock;
9mod arguments;
10mod column;
11mod connection;
12mod copy;
13mod database;
14mod error;
15mod io;
16mod listener;
17mod message;
18mod options;
19mod query_result;
20mod row;
21mod statement;
22mod transaction;
23mod type_info;
24pub mod types;
25mod value;
26
27#[cfg(feature = "any")]
28pub mod any;
29
30#[cfg(feature = "migrate")]
31mod migrate;
32
33#[cfg(feature = "migrate")]
34mod testing;
35
36pub(crate) use sqlx_core::driver_prelude::*;
37
38pub use advisory_lock::{PgAdvisoryLock, PgAdvisoryLockGuard, PgAdvisoryLockKey};
39pub use arguments::{PgArgumentBuffer, PgArguments};
40pub use column::PgColumn;
41pub use connection::PgConnection;
42pub use copy::PgCopyIn;
43pub use database::Postgres;
44pub use error::{PgDatabaseError, PgErrorPosition};
45pub use listener::{PgListener, PgNotification};
46pub use message::PgSeverity;
47pub use options::{PgConnectOptions, PgSslMode};
48pub use query_result::PgQueryResult;
49pub use row::PgRow;
50pub use statement::PgStatement;
51pub use transaction::PgTransactionManager;
52pub use type_info::{PgTypeInfo, PgTypeKind};
53pub use types::PgHasArrayType;
54pub use value::{PgValue, PgValueFormat, PgValueRef};
55
56/// An alias for [`Pool`][crate::pool::Pool], specialized for Postgres.
57pub type PgPool = crate::pool::Pool<Postgres>;
58
59/// An alias for [`PoolOptions`][crate::pool::PoolOptions], specialized for Postgres.
60pub type PgPoolOptions = crate::pool::PoolOptions<Postgres>;
61
62/// An alias for [`Executor<'_, Database = Postgres>`][Executor].
63pub trait PgExecutor<'c>: Executor<'c, Database = Postgres> {}
64impl<'c, T: Executor<'c, Database = Postgres>> PgExecutor<'c> for T {}
65
66impl_into_arguments_for_arguments!(PgArguments);
67impl_acquire!(Postgres, PgConnection);
68impl_column_index_for_row!(PgRow);
69impl_column_index_for_statement!(PgStatement);
70impl_encode_for_option!(Postgres);