pub trait PgMetadataLookup {
// Required method
fn lookup_type(
&mut self,
type_name: &str,
schema: Option<&str>,
) -> PgTypeMetadata;
// Provided method
fn as_any<'a>(&mut self) -> &mut (dyn Any + 'a)
where Self: 'a { ... }
}
Available on crate feature
postgres_backend
only.Expand description
Determines the OID of types at runtime
Custom implementations of Connection<Backend = Pg>
should not implement this trait directly.
Instead GetPgMetadataCache
should be implemented, afterwards the generic implementation will provide
the necessary functions to perform the type lookup.
Required Methods§
Sourcefn lookup_type(
&mut self,
type_name: &str,
schema: Option<&str>,
) -> PgTypeMetadata
fn lookup_type( &mut self, type_name: &str, schema: Option<&str>, ) -> PgTypeMetadata
Determine the type metadata for the given type_name
This function should only be used for user defined types, or types which come from an extension. This function may perform a SQL query to look up the type. For built-in types, a static OID should be preferred.