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