pub enum ObjectReference<X: Extension = NoExt> {
Named {
kind: ObjectRefKind,
name: ObjectName,
meta: Meta,
},
Routine {
kind: RoutineObjectKind,
signature: RoutineSignature<X>,
meta: Meta,
},
Aggregate {
name: ObjectName,
args: AggregateArgs<X>,
meta: Meta,
},
Operator {
schema: ObjectName,
op: Symbol,
args: OperatorArgs<X>,
meta: Meta,
},
OperatorClass {
family: bool,
name: ObjectName,
access_method: Ident,
meta: Meta,
},
Cast {
from: DataType<X>,
to: DataType<X>,
meta: Meta,
},
Type {
domain: bool,
name: DataType<X>,
meta: Meta,
},
Transform {
type_name: DataType<X>,
language: Ident,
meta: Meta,
},
Trigger {
name: Ident,
table: ObjectName,
meta: Meta,
},
}Expand description
A reference to a database object by kind and kind-appropriate signature — the shared object-reference axis for PostgreSQL object-membership DDL.
PostgreSQL’s ALTER EXTENSION … ADD|DROP <member> grammar
(AlterExtensionContentsStmt) names a member object by a kind keyword plus a
signature whose shape depends on the kind: a bare or qualified name, a routine
argument-type signature, an aggregate/operator signature, a cast type pair, a type
name, or a transform. The sibling object-DDL heads name objects the same way — the
parse-pg-alter-object-depends head (ALTER … DEPENDS ON EXTENSION) reuses
Routine and Named for its FUNCTION/PROCEDURE/
ROUTINE, MATERIALIZED VIEW, and INDEX objects, and parse-pg-drop-transform
reuses Transform — so the axis lives here once rather than being
re-derived per head.
Trigger is the one shape no ALTER EXTENSION member takes: its
TRIGGER <name> ON <table> form is exclusive to the DEPENDS ON EXTENSION head
(ALTER EXTENSION … ADD TRIGGER is a reject), so it was added to the axis additively
when that head’s measured grammar demanded it, keeping every object-DDL head on one
shared reference type.
Variants§
Named
A kind keyword and a name. kind records whether the name may be
schema-qualified: PostgreSQL’s object_type_any_name kinds (TABLE, VIEW, …)
accept a dotted any_name, its object_type_name kinds (SCHEMA, ROLE, …)
only a single name.
Routine
FUNCTION/PROCEDURE/ROUTINE <name>[(<argtypes>)]
(PostgreSQL’s function_with_argtypes; the argument list is optional).
Fields
kind: RoutineObjectKindWhich routine kind; see RoutineObjectKind.
signature: RoutineSignature<X>The routine name and optional argument-type signature.
Aggregate
AGGREGATE <name>(<aggr_args>).
Operator
OPERATOR [<schema>.]<sym>(<left>, <right>) (PostgreSQL’s operator_with_argtypes).
Fields
schema: ObjectNameThe optional schema qualification (empty for an unqualified operator).
args: OperatorArgs<X>The operand types.
OperatorClass
OPERATOR CLASS/OPERATOR FAMILY <name> USING <access_method>.
Fields
name: ObjectNameThe operator class/family name.
Cast
CAST (<from> AS <to>).
Fields
Type
DOMAIN/TYPE <typename> — a type-named object.
Fields
Transform
TRANSFORM FOR <typename> LANGUAGE <language>.
Fields
Trigger
TRIGGER <name> ON <table> — a trigger named by its bare name plus the table it
is defined on (PostgreSQL’s ALTER TRIGGER name ON qualified_name). Unlike the
other object kinds, a trigger is not schema-qualifiable on its own name (it is a
name, a single ColId); the table carries the qualification.
This variant is reached only by the DEPENDS ON EXTENSION head — no ALTER EXTENSION member is a trigger — so parse_object_reference never constructs it.
Trait Implementations§
Source§impl<X: Clone + Extension> Clone for ObjectReference<X>
impl<X: Clone + Extension> Clone for ObjectReference<X>
Source§fn clone(&self) -> ObjectReference<X>
fn clone(&self) -> ObjectReference<X>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, X> Deserialize<'de> for ObjectReference<X>where
X: Deserialize<'de> + Extension,
impl<'de, X> Deserialize<'de> for ObjectReference<X>where
X: Deserialize<'de> + Extension,
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>,
impl<X: Eq + Extension> Eq for ObjectReference<X>
Source§impl<X: Extension + Render> Render for ObjectReference<X>
impl<X: Extension + Render> Render for ObjectReference<X>
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl<X> Serialize for ObjectReference<X>
impl<X> Serialize for ObjectReference<X>
Source§impl<X: Extension> Spanned for ObjectReference<X>
impl<X: Extension> Spanned for ObjectReference<X>
impl<X: PartialEq + Extension> StructuralPartialEq for ObjectReference<X>
Auto Trait Implementations§
impl<X> Freeze for ObjectReference<X>where
X: Freeze,
impl<X> RefUnwindSafe for ObjectReference<X>where
X: RefUnwindSafe,
impl<X> Send for ObjectReference<X>where
X: Send,
impl<X> Sync for ObjectReference<X>where
X: Sync,
impl<X> Unpin for ObjectReference<X>where
X: Unpin,
impl<X> UnsafeUnpin for ObjectReference<X>where
X: UnsafeUnpin,
impl<X> UnwindSafe for ObjectReference<X>where
X: UnwindSafe,
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> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.