Struct sqlx::postgres::PgTypeInfo
source · pub struct PgTypeInfo(_);
Available on crate feature
postgres
only.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 const fn with_name(name: &'static str) -> PgTypeInfo
pub const fn with_name(name: &'static str) -> PgTypeInfo
Create a PgTypeInfo
from a type name.
The OID for the type will be fetched from Postgres on use of a value of this type. The fetched OID will be cached per-connection.
sourcepub const fn with_oid(oid: Oid) -> PgTypeInfo
pub const fn with_oid(oid: Oid) -> PgTypeInfo
Create a PgTypeInfo
from an OID.
Note that the OID for a type is very dependent on the environment. If you only ever use
one database or if this is an unhandled built-in type, you should be fine. Otherwise,
you will be better served using with_name
.
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 From<PgTypeInfo> for AnyTypeInfo
impl From<PgTypeInfo> for AnyTypeInfo
source§fn from(ty: PgTypeInfo) -> AnyTypeInfo
fn from(ty: PgTypeInfo) -> AnyTypeInfo
Converts to this type from the input type.
source§impl PartialEq<PgTypeInfo> for PgTypeInfo
impl PartialEq<PgTypeInfo> 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.