Struct sqlx_postgres::PgTypeInfo
source · pub struct PgTypeInfo(/* private fields */);
Expand description
Type information for a PostgreSQL type.
Implementations§
source§impl PgTypeInfo
impl PgTypeInfo
sourcepub fn kind(&self) -> &PgTypeKind
pub fn kind(&self) -> &PgTypeKind
Returns the kind (simple, array, enum, etc.) for this type.
sourcepub fn oid(&self) -> Option<Oid>
pub fn oid(&self) -> Option<Oid>
Returns the OID for this type, if available.
The OID may not be available if SQLx only knows the type by name.
It will have to be resolved by a PgConnection
at runtime which
will yield a new and semantically distinct TypeInfo
instance.
This method does not perform any such lookup.
§Note
With the exception of the default pg_type
catalog, type OIDs are not stable in PostgreSQL.
If a type is added by an extension, its OID will be assigned when the CREATE EXTENSION
statement is executed,
and so can change depending on what extensions are installed and in what order, as well as the exact
version of PostgreSQL.
Trait Implementations§
source§impl Clone for PgTypeInfo
impl Clone for PgTypeInfo
source§fn clone(&self) -> PgTypeInfo
fn clone(&self) -> PgTypeInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PgTypeInfo
impl Debug for PgTypeInfo
source§impl Deref for PgTypeInfo
impl Deref for PgTypeInfo
source§impl Display for PgTypeInfo
impl Display for PgTypeInfo
source§impl PartialEq for PgTypeInfo
impl PartialEq for PgTypeInfo
source§fn eq(&self, other: &PgTypeInfo) -> bool
fn eq(&self, other: &PgTypeInfo) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TypeInfo for PgTypeInfo
impl TypeInfo for PgTypeInfo
source§fn name(&self) -> &str
fn name(&self) -> &str
Returns the database system name of the type. Length specifiers should not be included.
Common type names are
VARCHAR
, TEXT
, or INT
. Type names should be uppercase. They
should be a rough approximation of how they are written in SQL in the given database.fn is_null(&self) -> bool
impl StructuralPartialEq for PgTypeInfo
Auto Trait Implementations§
impl Freeze for PgTypeInfo
impl RefUnwindSafe for PgTypeInfo
impl Send for PgTypeInfo
impl Sync for PgTypeInfo
impl Unpin for PgTypeInfo
impl UnwindSafe for PgTypeInfo
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