Skip to main content

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