| 1 |
//! Provides types and functions related to working with PostgreSQL |
| 2 |
//! |
| 3 |
//! Much of this module is re-exported from database agnostic locations. |
| 4 |
//! However, if you are writing code specifically to extend Diesel on |
| 5 |
//! PostgreSQL, you may need to work with this module directly. |
| 6 |
|
| 7 |
pub mod expression; |
| 8 |
mod types; |
| 9 |
|
| 10 |
pub(crate) mod backend; |
| 11 |
#[cfg(feature = "postgres")] |
| 12 |
pub(crate) mod connection; |
| 13 |
mod metadata_lookup; |
| 14 |
pub(crate) mod query_builder; |
| 15 |
pub(crate) mod serialize; |
| 16 |
mod transaction; |
| 17 |
mod value; |
| 18 |
|
| 19 |
#[doc(inline)] |
| 20 |
pub use self::backend::{Pg, PgNotification, PgTypeMetadata}; |
| 21 |
#[cfg(feature = "postgres")] |
| 22 |
pub use self::connection::{PgConnection, PgRowByRowLoadingMode}; |
| 23 |
#[doc(inline)] |
| 24 |
pub use self::metadata_lookup::PgMetadataLookup; |
| 25 |
#[doc(inline)] |
| 26 |
pub use self::query_builder::DistinctOnClause; |
| 27 |
#[doc(inline)] |
| 28 |
pub use self::query_builder::OrderDecorator; |
| 29 |
#[doc(inline)] |
| 30 |
pub use self::query_builder::PgQueryBuilder; |
| 31 |
#[doc(inline)] |
| 32 |
pub use self::query_builder::{CopyFormat, CopyFromQuery, CopyHeader, CopyTarget, CopyToQuery}; |
| 33 |
#[doc(inline)] |
| 34 |
pub use self::transaction::TransactionBuilder; |
| 35 |
#[doc(inline)] |
| 36 |
pub use self::value::PgValue; |
| 37 |
|
| 38 |
#[doc(inline)] |
| 39 |
#[cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes")] |
| 40 |
pub use self::backend::FailedToLookupTypeError; |
| 41 |
#[doc(inline)] |
| 42 |
#[cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes")] |
| 43 |
pub use self::metadata_lookup::{GetPgMetadataCache, PgMetadataCache, PgMetadataCacheKey}; |
| 44 |
#[doc(inline)] |
| 45 |
#[cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes")] |
| 46 |
pub use self::value::TypeOidLookup; |
| 47 |
|
| 48 |
#[doc(hidden)] |
| 49 |
#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))] |
| 50 |
#[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")] |
| 51 |
pub use crate::upsert; |
| 52 |
|
| 53 |
/// Data structures for PG types which have no corresponding Rust type |
| 54 |
/// |
| 55 |
/// Most of these types are used to implement `ToSql` and `FromSql` for higher |
| 56 |
/// level types. |
| 57 |
pub mod data_types { |
| 58 |
#[doc(inline)] |
| 59 |
pub use super::types::date_and_time::{PgDate, PgInterval, PgTime, PgTimestamp}; |
| 60 |
#[doc(inline)] |
| 61 |
pub use super::types::floats::PgNumeric; |
| 62 |
#[doc(inline)] |
| 63 |
pub use super::types::money::PgMoney; |
| 64 |
pub use super::types::money::PgMoney as Cents; |
| 65 |
#[doc(inline)] |
| 66 |
pub use super::types::pg_lsn::PgLsn; |
| 67 |
} |
| 68 |
|
| 69 |
#[doc(inline)] |
| 70 |
pub use self::types::sql_types; |