mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-07 10:46:06 +00:00
Add PgTypeInfo::with_oid
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user