pub struct Postgres;
Expand description
PostgreSQL database driver.
Trait Implementations§
Source§impl Database for Postgres
impl Database for Postgres
Source§const URL_SCHEMES: &'static [&'static str] = _
const URL_SCHEMES: &'static [&'static str] = _
The schemes for database URLs that should match this driver.
Source§type Connection = PgConnection
type Connection = PgConnection
The concrete
Connection
implementation for this database.Source§type TransactionManager = PgTransactionManager
type TransactionManager = PgTransactionManager
The concrete
TransactionManager
implementation for this database.Source§type QueryResult = PgQueryResult
type QueryResult = PgQueryResult
The concrete
QueryResult
implementation for this database.Source§type TypeInfo = PgTypeInfo
type TypeInfo = PgTypeInfo
The concrete
TypeInfo
implementation for this database.Source§type Value = PgValue
type Value = PgValue
The concrete type used to hold an owned copy of the not-yet-decoded value that was
received from the database.
Source§type ValueRef<'r> = PgValueRef<'r>
type ValueRef<'r> = PgValueRef<'r>
The concrete type used to hold a reference to the not-yet-decoded value that has just been
received from the database.
Source§type Arguments<'q> = PgArguments
type Arguments<'q> = PgArguments
The concrete
Arguments
implementation for this database.Source§type ArgumentBuffer<'q> = PgArgumentBuffer
type ArgumentBuffer<'q> = PgArgumentBuffer
The concrete type used as a buffer for arguments while encoding.
Source§type Statement<'q> = PgStatement<'q>
type Statement<'q> = PgStatement<'q>
The concrete
Statement
implementation for this database.Source§impl Encode<'_, Postgres> for &[u8]
impl Encode<'_, Postgres> for &[u8]
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl Encode<'_, Postgres> for &str
impl Encode<'_, Postgres> for &str
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl Encode<'_, Postgres> for Box<[u8]>
impl Encode<'_, Postgres> for Box<[u8]>
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl Encode<'_, Postgres> for Box<str>
impl Encode<'_, Postgres> for Box<str>
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl Encode<'_, Postgres> for String
impl Encode<'_, Postgres> for String
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl Encode<'_, Postgres> for Uuid
impl Encode<'_, Postgres> for Uuid
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl Encode<'_, Postgres> for Vec<u8>
impl Encode<'_, Postgres> for Vec<u8>
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl<'q, T> Encode<'q, Postgres> for &[T]
impl<'q, T> Encode<'q, Postgres> for &[T]
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl<'q, T> Encode<'q, Postgres> for Vec<T>
impl<'q, T> Encode<'q, Postgres> for Vec<T>
Source§fn encode_by_ref(
&self,
buf: &mut PgArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>
fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self
into buf
in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl MigrateDatabase for Postgres
impl MigrateDatabase for Postgres
fn create_database( url: &str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
fn database_exists( url: &str, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + '_>>
fn drop_database( url: &str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
fn force_drop_database( url: &str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
Source§impl TestSupport for Postgres
impl TestSupport for Postgres
Source§fn test_context(
args: &TestArgs,
) -> Pin<Box<dyn Future<Output = Result<TestContext<Postgres>, Error>> + Send + '_>>
fn test_context( args: &TestArgs, ) -> Pin<Box<dyn Future<Output = Result<TestContext<Postgres>, Error>> + Send + '_>>
Get parameters to construct a
Pool
suitable for testing. Read morefn cleanup_test( db_name: &str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
Source§impl<T> Type<Postgres> for [T]where
T: PgHasArrayType,
impl<T> Type<Postgres> for [T]where
T: PgHasArrayType,
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl<T, const N: usize> Type<Postgres> for [T; N]where
T: PgHasArrayType,
impl<T, const N: usize> Type<Postgres> for [T; N]where
T: PgHasArrayType,
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for ()
impl Type<Postgres> for ()
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl<T1, T2, T3> Type<Postgres> for (T1, T2, T3)
impl<T1, T2, T3> Type<Postgres> for (T1, T2, T3)
Source§impl<T1, T2, T3, T4> Type<Postgres> for (T1, T2, T3, T4)
impl<T1, T2, T3, T4> Type<Postgres> for (T1, T2, T3, T4)
Source§impl<T1, T2, T3, T4, T5> Type<Postgres> for (T1, T2, T3, T4, T5)
impl<T1, T2, T3, T4, T5> Type<Postgres> for (T1, T2, T3, T4, T5)
Source§impl<T1, T2, T3, T4, T5, T6> Type<Postgres> for (T1, T2, T3, T4, T5, T6)
impl<T1, T2, T3, T4, T5, T6> Type<Postgres> for (T1, T2, T3, T4, T5, T6)
Source§impl<T1, T2, T3, T4, T5, T6, T7> Type<Postgres> for (T1, T2, T3, T4, T5, T6, T7)
impl<T1, T2, T3, T4, T5, T6, T7> Type<Postgres> for (T1, T2, T3, T4, T5, T6, T7)
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8> Type<Postgres> for (T1, T2, T3, T4, T5, T6, T7, T8)
impl<T1, T2, T3, T4, T5, T6, T7, T8> Type<Postgres> for (T1, T2, T3, T4, T5, T6, T7, T8)
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> Type<Postgres> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> Type<Postgres> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)
Source§impl Type<Postgres> for ActivityProgress
impl Type<Postgres> for ActivityProgress
Source§impl Type<Postgres> for Box<str>
impl Type<Postgres> for Box<str>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for CertificateTextAnchor
impl Type<Postgres> for CertificateTextAnchor
Source§impl Type<Postgres> for CourseBackgroundQuestionType
impl Type<Postgres> for CourseBackgroundQuestionType
Source§impl Type<Postgres> for Cow<'_, str>
impl Type<Postgres> for Cow<'_, str>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for ExerciseRepositoryStatus
impl Type<Postgres> for ExerciseRepositoryStatus
Source§impl Type<Postgres> for GradingProgress
impl Type<Postgres> for GradingProgress
Source§impl Type<Postgres> for HistoryChangeReason
impl Type<Postgres> for HistoryChangeReason
Source§impl<T> Type<Postgres> for Json<T>
impl<T> Type<Postgres> for Json<T>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for NaiveDateTime
impl Type<Postgres> for NaiveDateTime
Source§impl Type<Postgres> for PeerOrSelfReviewQuestionType
impl Type<Postgres> for PeerOrSelfReviewQuestionType
Source§impl Type<Postgres> for PeerReviewProcessingStrategy
impl Type<Postgres> for PeerReviewProcessingStrategy
Source§impl Type<Postgres> for PgCiText
impl Type<Postgres> for PgCiText
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for PgInterval
impl Type<Postgres> for PgInterval
Source§impl<Tz> Type<Postgres> for PgRange<DateTime<Tz>>where
Tz: TimeZone,
impl<Tz> Type<Postgres> for PgRange<DateTime<Tz>>where
Tz: TimeZone,
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for PgRange<NaiveDate>
impl Type<Postgres> for PgRange<NaiveDate>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for PgRange<NaiveDateTime>
impl Type<Postgres> for PgRange<NaiveDateTime>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for PgRange<i32>
impl Type<Postgres> for PgRange<i32>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for PgRange<i64>
impl Type<Postgres> for PgRange<i64>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for ProposalStatus
impl Type<Postgres> for ProposalStatus
Source§impl Type<Postgres> for ReportReason
impl Type<Postgres> for ReportReason
Source§impl Type<Postgres> for ReviewingStage
impl Type<Postgres> for ReviewingStage
Source§impl Type<Postgres> for String
impl Type<Postgres> for String
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for TeacherDecisionType
impl Type<Postgres> for TeacherDecisionType
Source§impl<T> Type<Postgres> for Text<T>
impl<T> Type<Postgres> for Text<T>
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for UserPointsUpdateStrategy
impl Type<Postgres> for UserPointsUpdateStrategy
Source§impl<T> Type<Postgres> for Vec<T>where
T: PgHasArrayType,
impl<T> Type<Postgres> for Vec<T>where
T: PgHasArrayType,
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl Type<Postgres> for str
impl Type<Postgres> for str
Source§fn type_info() -> PgTypeInfo
fn type_info() -> PgTypeInfo
Returns the canonical SQL type for this Rust type. Read more
Source§fn compatible(ty: &PgTypeInfo) -> bool
fn compatible(ty: &PgTypeInfo) -> bool
Determines if this Rust type is compatible with the given SQL type. Read more
Source§impl TypeChecking for Postgres
impl TypeChecking for Postgres
Source§const PARAM_CHECKING: ParamChecking = ::sqlx_core::type_checking::ParamChecking::Strong
const PARAM_CHECKING: ParamChecking = ::sqlx_core::type_checking::ParamChecking::Strong
Describes how the database in question typechecks query parameters.
Source§fn param_type_for_id(
info: &<Postgres as Database>::TypeInfo,
) -> Option<&'static str>
fn param_type_for_id( info: &<Postgres as Database>::TypeInfo, ) -> Option<&'static str>
Get the full path of the Rust type that corresponds to the given
TypeInfo
, if applicable. Read moreSource§fn return_type_for_id(
info: &<Postgres as Database>::TypeInfo,
) -> Option<&'static str>
fn return_type_for_id( info: &<Postgres as Database>::TypeInfo, ) -> Option<&'static str>
Get the full path of the Rust type that corresponds to the given
TypeInfo
, if applicable. Read moreimpl HasStatementCache for Postgres
Auto Trait Implementations§
impl Freeze for Postgres
impl RefUnwindSafe for Postgres
impl Send for Postgres
impl Sync for Postgres
impl Unpin for Postgres
impl UnwindSafe for Postgres
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more