Skip to main content

PostgresDialect

Struct PostgresDialect 

Source
pub struct PostgresDialect;
Expand description

Type-level marker for PostgreSQL.

Selects PostgreSQL type mappings (DialectTypes, SQLTypeToRust). PostgreSQL has native date/time, UUID and JSON types, so selecting them needs a matching feature (chrono, time or jiff; uuid; serde).

Trait Implementations§

Source§

impl AggregatePolicy<PostgresDialect> for Int2

Source§

type Sum = Int8

Result type of SUM.
Source§

type Avg = Float8

Result type of AVG.
Source§

impl AggregatePolicy<PostgresDialect> for Int4

Source§

type Sum = Int8

Result type of SUM.
Source§

type Avg = Float8

Result type of AVG.
Source§

impl AggregatePolicy<PostgresDialect> for Int8

Source§

type Sum = Int8

Result type of SUM.
Source§

type Avg = Float8

Result type of AVG.
Source§

impl AggregatePolicy<PostgresDialect> for Float4

Source§

type Sum = Float8

Result type of SUM.
Source§

type Avg = Float8

Result type of AVG.
Source§

impl AggregatePolicy<PostgresDialect> for Float8

Source§

type Sum = Float8

Result type of SUM.
Source§

type Avg = Float8

Result type of AVG.
Source§

impl AggregatePolicy<PostgresDialect> for Numeric

Source§

type Sum = Numeric

Result type of SUM.
Source§

type Avg = Numeric

Result type of AVG.
Source§

impl BooleanAggregatePolicy<PostgresDialect> for Boolean

Source§

impl<Source: DataType + Compatible<Target>, Target: DataType> CastTypePolicy<PostgresDialect, Source, Target> for ()

Source§

impl Clone for PostgresDialect

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PostgresDialect

Source§

impl DateTruncPolicy<PostgresDialect> for Timestamptz

Source§

type Output = Timestamptz

Result type of DATE_TRUNC.
Source§

impl DateTruncPolicy<PostgresDialect> for Timestamp

Source§

type Output = Timestamp

Result type of DATE_TRUNC.
Source§

impl Debug for PostgresDialect

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DialectSupports<AggregateFilter> for PostgresDialect

Source§

impl DialectSupports<Excluded> for PostgresDialect

Source§

impl DialectSupports<LeftRight> for PostgresDialect

Source§

impl DialectSupports<Pad> for PostgresDialect

Source§

impl DialectSupports<PostgresAggregate> for PostgresDialect

Source§

impl DialectSupports<PostgresDateTime> for PostgresDialect

Source§

impl DialectSupports<PostgresString> for PostgresDialect

Source§

impl DialectSupports<Repeat> for PostgresDialect

Source§

impl DialectSupports<Reverse> for PostgresDialect

Source§

impl DialectSupports<Sequence> for PostgresDialect

Source§

impl DialectTypes for PostgresDialect

Source§

const CHAR_LENGTH_FN: &'static str = "CHAR_LENGTH"

Name of the character-count function (LENGTH on SQLite).
Source§

type SmallInt = Int2

16-bit integer.
Source§

type Int = Int4

32-bit integer.
Source§

type BigInt = Int8

64-bit integer.
Source§

type Float = Float4

Single-precision float.
Source§

type Double = Float8

Double-precision float.
Source§

type Text = Text

Text.
Source§

type Bool = Boolean

Boolean (an integer on SQLite).
Source§

type Bytes = Bytea

Binary data.
Source§

type Date = Date

Calendar date.
Source§

type Time = Time

Time of day.
Source§

type Timestamp = Timestamp

Date and time without a time zone.
Source§

type TimestampTz = Timestamptz

Date and time with a time zone.
Source§

type Uuid = Uuid

UUID.
Source§

type Json = Json

JSON.
Source§

type Jsonb = Jsonb

Binary JSON (jsonb; plain JSON where the dialect has no jsonb).
Source§

type Any = Any

A value of unknown type.
Source§

type Random = Float8

Result type of RANDOM().
Source§

type Sign = Float8

Result type of SIGN(x).
Source§

type DomainNullable<Input: Nullability> = Input

Nullability of a math function whose domain is narrower than its input type (SQRT, LN, LOG, …) given input nullability Input: SQLite and MySQL answer NULL outside the domain, PostgreSQL raises.
Source§

impl<L, R> GreatestLeastPolicy<L, R> for PostgresDialect
where L: Nullability, R: Nullability,

Source§

type Nullable = <L as Nullability>::And<R>

Nullability of the result.
Source§

type Sources<A, B> = Coalesce<A, B>

How the operands’ sources (each an Arg) combine.
Source§

impl LengthPolicy<PostgresDialect> for Varchar

Source§

type Output = Int4

Result type of the length functions.
Source§

impl LengthPolicy<PostgresDialect> for Text

Source§

type Output = Int4

Result type of the length functions.
Source§

impl LengthPolicy<PostgresDialect> for Char

Source§

type Output = Int4

Result type of the length functions.
Source§

impl MathExt for PostgresDialect

Source§

impl RoundingPolicy<PostgresDialect> for Int2

Source§

type Output = Float8

Result type of the rounding functions.
Source§

fn coerce_result<'a, V: SQLParam + 'a>(sql: SQL<'a, V>) -> SQL<'a, V>

Coerces a rounding function’s result to Self::Output. Read more
Source§

fn precision_operand<'a, V: SQLParam + 'a>(expr: SQL<'a, V>) -> SQL<'a, V>

Prepares the operand of ROUND(expr, precision). Read more
Source§

impl RoundingPolicy<PostgresDialect> for Int4

Source§

type Output = Float8

Result type of the rounding functions.
Source§

fn coerce_result<'a, V: SQLParam + 'a>(sql: SQL<'a, V>) -> SQL<'a, V>

Coerces a rounding function’s result to Self::Output. Read more
Source§

fn precision_operand<'a, V: SQLParam + 'a>(expr: SQL<'a, V>) -> SQL<'a, V>

Prepares the operand of ROUND(expr, precision). Read more
Source§

impl RoundingPolicy<PostgresDialect> for Int8

Source§

type Output = Float8

Result type of the rounding functions.
Source§

fn coerce_result<'a, V: SQLParam + 'a>(sql: SQL<'a, V>) -> SQL<'a, V>

Coerces a rounding function’s result to Self::Output. Read more
Source§

fn precision_operand<'a, V: SQLParam + 'a>(expr: SQL<'a, V>) -> SQL<'a, V>

Prepares the operand of ROUND(expr, precision). Read more
Source§

impl RoundingPolicy<PostgresDialect> for Numeric

Source§

type Output = Float8

Result type of the rounding functions.
Source§

fn coerce_result<'a, V: SQLParam + 'a>(sql: SQL<'a, V>) -> SQL<'a, V>

Coerces a rounding function’s result to Self::Output. Read more
Source§

fn precision_operand<'a, V: SQLParam + 'a>(expr: SQL<'a, V>) -> SQL<'a, V>

Prepares the operand of ROUND(expr, precision). Read more
Source§

impl RoundingPolicy<PostgresDialect> for Float4

Source§

type Output = Float8

Result type of the rounding functions.
Source§

fn precision_operand<'a, V: SQLParam + 'a>(expr: SQL<'a, V>) -> SQL<'a, V>

Prepares the operand of ROUND(expr, precision). Read more
Source§

fn coerce_result<'a, V: SQLParam + 'a>(sql: SQL<'a, V>) -> SQL<'a, V>

Coerces a rounding function’s result to Self::Output. Read more
Source§

impl RoundingPolicy<PostgresDialect> for Float8

Source§

type Output = Float8

Result type of the rounding functions.
Source§

fn precision_operand<'a, V: SQLParam + 'a>(expr: SQL<'a, V>) -> SQL<'a, V>

Prepares the operand of ROUND(expr, precision). Read more
Source§

fn coerce_result<'a, V: SQLParam + 'a>(sql: SQL<'a, V>) -> SQL<'a, V>

Coerces a rounding function’s result to Self::Output. Read more
Source§

impl SQLTypeToRust<PostgresDialect> for Int2

Source§

impl SQLTypeToRust<PostgresDialect> for Int4

Source§

impl SQLTypeToRust<PostgresDialect> for Int8

Source§

impl SQLTypeToRust<PostgresDialect> for Float4

Source§

impl SQLTypeToRust<PostgresDialect> for Float8

Source§

impl SQLTypeToRust<PostgresDialect> for Varchar

Source§

impl SQLTypeToRust<PostgresDialect> for Text

Source§

impl SQLTypeToRust<PostgresDialect> for Char

Source§

impl SQLTypeToRust<PostgresDialect> for Bytea

Source§

impl SQLTypeToRust<PostgresDialect> for Boolean

Source§

impl SQLTypeToRust<PostgresDialect> for Numeric

Available on non-crate feature rust-decimal only.
Source§

impl SQLTypeToRust<PostgresDialect> for Any

Source§

impl SQLTypeToRust<PostgresDialect> for Interval

Available on non-crate feature chrono only.
Source§

impl SQLTypeToRust<PostgresDialect> for Inet

Available on non-crate feature cidr only.
Source§

impl SQLTypeToRust<PostgresDialect> for Cidr

Available on non-crate feature cidr only.
Source§

impl SQLTypeToRust<PostgresDialect> for MacAddr

Source§

impl SQLTypeToRust<PostgresDialect> for MacAddr8

Source§

impl SQLTypeToRust<PostgresDialect> for Point

Available on non-crate feature geo-types only.
Source§

impl SQLTypeToRust<PostgresDialect> for LineString

Available on non-crate feature geo-types only.
Source§

impl SQLTypeToRust<PostgresDialect> for Rect

Available on non-crate feature geo-types only.
Source§

impl SQLTypeToRust<PostgresDialect> for BitString

Available on non-crate feature bit-vec only.
Source§

impl SQLTypeToRust<PostgresDialect> for Line

Source§

impl SQLTypeToRust<PostgresDialect> for LineSegment

Source§

impl SQLTypeToRust<PostgresDialect> for Polygon

Source§

impl SQLTypeToRust<PostgresDialect> for Circle

Source§

impl SQLTypeToRust<PostgresDialect> for Enum

Source§

impl StatisticalAggregatePolicy<PostgresDialect> for Int2

Source§

type StddevPop = Float8

Result type of STDDEV_POP.
Source§

type StddevSamp = Float8

Result type of STDDEV_SAMP.
Source§

type VarPop = Float8

Result type of VAR_POP.
Source§

type VarSamp = Float8

Result type of VAR_SAMP / VARIANCE.
Source§

impl StatisticalAggregatePolicy<PostgresDialect> for Int4

Source§

type StddevPop = Float8

Result type of STDDEV_POP.
Source§

type StddevSamp = Float8

Result type of STDDEV_SAMP.
Source§

type VarPop = Float8

Result type of VAR_POP.
Source§

type VarSamp = Float8

Result type of VAR_SAMP / VARIANCE.
Source§

impl StatisticalAggregatePolicy<PostgresDialect> for Int8

Source§

type StddevPop = Float8

Result type of STDDEV_POP.
Source§

type StddevSamp = Float8

Result type of STDDEV_SAMP.
Source§

type VarPop = Float8

Result type of VAR_POP.
Source§

type VarSamp = Float8

Result type of VAR_SAMP / VARIANCE.
Source§

impl StatisticalAggregatePolicy<PostgresDialect> for Float4

Source§

type StddevPop = Float8

Result type of STDDEV_POP.
Source§

type StddevSamp = Float8

Result type of STDDEV_SAMP.
Source§

type VarPop = Float8

Result type of VAR_POP.
Source§

type VarSamp = Float8

Result type of VAR_SAMP / VARIANCE.
Source§

impl StatisticalAggregatePolicy<PostgresDialect> for Float8

Source§

type StddevPop = Float8

Result type of STDDEV_POP.
Source§

type StddevSamp = Float8

Result type of STDDEV_SAMP.
Source§

type VarPop = Float8

Result type of VAR_POP.
Source§

type VarSamp = Float8

Result type of VAR_SAMP / VARIANCE.
Source§

impl StatisticalAggregatePolicy<PostgresDialect> for Numeric

Source§

type StddevPop = Float8

Result type of STDDEV_POP.
Source§

type StddevSamp = Float8

Result type of STDDEV_SAMP.
Source§

type VarPop = Float8

Result type of VAR_POP.
Source§

type VarSamp = Float8

Result type of VAR_SAMP / VARIANCE.
Source§

impl ValueTypeForDialect<PostgresDialect> for i8

Source§

type SQLType = Int2

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for i16

Source§

type SQLType = Int2

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for u8

Source§

type SQLType = Int2

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for i32

Source§

type SQLType = Int4

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for u16

Source§

type SQLType = Int4

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for i64

Source§

type SQLType = Int8

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for u32

Source§

type SQLType = Int8

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for u64

Source§

type SQLType = Int8

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for isize

Source§

type SQLType = Int8

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for usize

Source§

type SQLType = Int8

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for f32

Source§

type SQLType = Float4

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for f64

Source§

type SQLType = Float8

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for bool

Source§

type SQLType = Boolean

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for &str

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Cow<'_, str>

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for String

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Box<String>

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Rc<String>

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Arc<String>

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Box<str>

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Rc<str>

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Arc<str>

Source§

type SQLType = Text

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for &[u8]

Source§

type SQLType = Bytea

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Cow<'_, [u8]>

Source§

type SQLType = Bytea

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<u8>

Source§

type SQLType = Bytea

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Box<Vec<u8>>

Source§

type SQLType = Bytea

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Rc<Vec<u8>>

Source§

type SQLType = Bytea

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Arc<Vec<u8>>

Source§

type SQLType = Bytea

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<String>

Source§

type SQLType = Array<Text>

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<&str>

Source§

type SQLType = Array<Text>

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<i16>

Source§

type SQLType = Array<Int2>

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<i32>

Source§

type SQLType = Array<Int4>

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<i64>

Source§

type SQLType = Array<Int8>

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<f32>

Source§

type SQLType = Array<Float4>

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<f64>

Source§

type SQLType = Array<Float8>

The SQL type marker.
Source§

impl ValueTypeForDialect<PostgresDialect> for Vec<bool>

Source§

type SQLType = Array<Boolean>

The SQL type marker.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Joined, From> JoinKey<From, JoinReverse> for Joined
where From: Joinable<Joined> + ?Sized,

Source§

fn pairs() -> &'static [(&'static str, &'static str)]

(joined_column, from_column) pairs the ON condition matches, in key order, read through Self::pair.
Source§

fn pair(pair: &(&'static str, &'static str)) -> (&'static str, &'static str)

The (joined_column, from_column) names of pair.
Source§

impl<List> ListIncludes<Nil, ()> for List

Source§

impl<Mk> MarkerAggValidFor<()> for Mk

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeEq<T> for T