pub enum CatalogObjectRef {
Schema(Identifier),
Sequence(QualifiedName),
Table(QualifiedName),
View(QualifiedName),
MaterializedView(QualifiedName),
UserType(QualifiedName),
Function {
name: QualifiedName,
signature: RoutineSignature,
},
Procedure {
name: QualifiedName,
signature: RoutineSignature,
},
Statistic(QualifiedName),
Collation(QualifiedName),
Publication(Identifier),
Subscription(Identifier),
}Expand description
A grantable / ownable schema object, carrying exactly the data its kind needs.
A routine argument-signature is representable ONLY on
CatalogObjectRef::Function / CatalogObjectRef::Procedure, so the old
signature: String field (documented as “empty for non-routine kinds”) —
an illegal state — is gone.
This subsumes the former OwnerObjectKind (the SQL keyword discriminant)
and OwnedObjectId (the name shape): schema / publication / subscription
render a bare Identifier; every other kind renders a QualifiedName.
Variants§
Schema(Identifier)
SCHEMA x — rendered as the bare schema name.
Sequence(QualifiedName)
SEQUENCE x.
Table(QualifiedName)
TABLE x.
View(QualifiedName)
VIEW x.
MaterializedView(QualifiedName)
MATERIALIZED VIEW x.
UserType(QualifiedName)
TYPE x.
Function
FUNCTION x(<signature>).
Fields
name: QualifiedNameQualified routine name.
signature: RoutineSignatureArgument-type signature suffix (with parens).
Procedure
PROCEDURE x(<signature>).
Fields
name: QualifiedNameQualified routine name.
signature: RoutineSignatureArgument-type signature suffix (with parens).
Statistic(QualifiedName)
STATISTICS x.
Collation(QualifiedName)
COLLATION x.
Publication(Identifier)
PUBLICATION x — cluster-level, rendered as the bare name.
Subscription(Identifier)
SUBSCRIPTION x — cluster-level, rendered as the bare name.
Implementations§
Source§impl CatalogObjectRef
impl CatalogObjectRef
Sourcepub const fn sql_keyword(&self) -> &'static str
pub const fn sql_keyword(&self) -> &'static str
The SQL keyword(s) used in GRANT ... ON <keyword> <name> /
ALTER <keyword> <name> OWNER TO <role>.
Sourcepub fn render_target(&self) -> String
pub fn render_target(&self) -> String
Render the object’s target name for use in
ALTER <kw> <here> OWNER TO <role>; / GRANT ... ON <kw> <here> ....
For routines this includes the signature suffix exactly as before
(format!("{}{}", name.render_sql(), signature.as_str())). Schema /
publication / subscription render the bare identifier; the rest render
the QualifiedName.
Sourcepub fn observation_label(&self) -> String
pub fn observation_label(&self) -> String
Human-readable label used in the grant observation side-channels
(UnmanagedGrantObservation / RevokeWithOwnerObservation), e.g.
"table app.users" or "function app.f(integer)".
The name is rendered via the identifier Display impl (raw, not
SQL-quoted) to byte-match the pre-dedup inline labels that built this
string with format!("table {qname}") and friends. This is distinct
from CatalogObjectRef::render_target, which SQL-quotes for emitted
statements.
Trait Implementations§
Source§impl Clone for CatalogObjectRef
impl Clone for CatalogObjectRef
Source§fn clone(&self) -> CatalogObjectRef
fn clone(&self) -> CatalogObjectRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CatalogObjectRef
impl Debug for CatalogObjectRef
Source§impl<'de> Deserialize<'de> for CatalogObjectRef
impl<'de> Deserialize<'de> for CatalogObjectRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CatalogObjectRef
impl Display for CatalogObjectRef
impl Eq for CatalogObjectRef
Source§impl PartialEq for CatalogObjectRef
impl PartialEq for CatalogObjectRef
Source§fn eq(&self, other: &CatalogObjectRef) -> bool
fn eq(&self, other: &CatalogObjectRef) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CatalogObjectRef
impl Serialize for CatalogObjectRef
impl StructuralPartialEq for CatalogObjectRef
Auto Trait Implementations§
impl Freeze for CatalogObjectRef
impl RefUnwindSafe for CatalogObjectRef
impl Send for CatalogObjectRef
impl Sync for CatalogObjectRef
impl Unpin for CatalogObjectRef
impl UnsafeUnpin for CatalogObjectRef
impl UnwindSafe for CatalogObjectRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more