mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-03 04:09:50 +00:00
Add PgTypeInfo::with_oid
This commit is contained in:
parent
9141bd7561
commit
f93beb460a
@ -24,6 +24,14 @@ impl PgTypeInfo {
|
||||
pub(crate) fn new(id: TypeId) -> Self {
|
||||
Self { id }
|
||||
}
|
||||
|
||||
/// Create a `PgTypeInfo` from a type's object identifier.
|
||||
///
|
||||
/// The object identifier of a type can be queried with
|
||||
/// `SELECT oid FROM pg_type WHERE typname = <name>;`
|
||||
pub fn with_oid(oid: u32) -> Self {
|
||||
Self { id: TypeId(oid) }
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for PgTypeInfo {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user