diesel/pg/
mod.rs

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
7pub mod expression;
8mod types;
9
10pub(crate) mod backend;
11#[cfg(feature = "postgres")]
12pub(crate) mod connection;
13mod metadata_lookup;
14pub(crate) mod query_builder;
15pub(crate) mod serialize;
16mod transaction;
17mod value;
18
19pub use self::backend::{Pg, PgTypeMetadata};
20#[cfg(feature = "postgres")]
21pub use self::connection::{PgConnection, PgRowByRowLoadingMode};
22#[doc(inline)]
23pub use self::metadata_lookup::PgMetadataLookup;
24#[doc(inline)]
25pub use self::query_builder::DistinctOnClause;
26#[doc(inline)]
27pub use self::query_builder::OrderDecorator;
28#[doc(inline)]
29pub use self::query_builder::PgQueryBuilder;
30#[doc(inline)]
31pub use self::query_builder::{CopyFormat, CopyFromQuery, CopyHeader, CopyTarget, CopyToQuery};
32#[doc(inline)]
33pub use self::transaction::TransactionBuilder;
34#[doc(inline)]
35pub use self::value::PgValue;
36
37#[doc(inline)]
38#[cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes")]
39pub use self::backend::FailedToLookupTypeError;
40#[doc(inline)]
41#[cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes")]
42pub use self::metadata_lookup::{GetPgMetadataCache, PgMetadataCache, PgMetadataCacheKey};
43#[doc(inline)]
44#[cfg(feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes")]
45pub use self::value::TypeOidLookup;
46
47#[doc(hidden)]
48#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
49#[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
50pub use crate::upsert;
51
52/// Data structures for PG types which have no corresponding Rust type
53///
54/// Most of these types are used to implement `ToSql` and `FromSql` for higher
55/// level types.
56pub mod data_types {
57    #[doc(inline)]
58    pub use super::types::date_and_time::{PgDate, PgInterval, PgTime, PgTimestamp};
59    #[doc(inline)]
60    pub use super::types::floats::PgNumeric;
61    #[doc(inline)]
62    pub use super::types::money::PgMoney;
63    pub use super::types::money::PgMoney as Cents;
64}
65
66#[doc(inline)]
67pub use self::types::sql_types;