pub struct SchemaCatalog { /* private fields */ }Expand description
Schema constraints and type definitions.
Implementations§
Source§impl SchemaCatalog
impl SchemaCatalog
Sourcepub fn register_node_type(
&self,
def: NodeTypeDefinition,
) -> Result<(), CatalogError>
pub fn register_node_type( &self, def: NodeTypeDefinition, ) -> Result<(), CatalogError>
Registers a new node type definition.
§Errors
Returns CatalogError::TypeAlreadyExists if a type with the same name exists.
Sourcepub fn register_or_replace_node_type(&self, def: NodeTypeDefinition)
pub fn register_or_replace_node_type(&self, def: NodeTypeDefinition)
Registers or replaces a node type definition.
Sourcepub fn drop_node_type(&self, name: &str) -> Result<(), CatalogError>
pub fn drop_node_type(&self, name: &str) -> Result<(), CatalogError>
Drops a node type definition by name.
§Errors
Returns CatalogError::TypeNotFound if no type with the given name exists.
Sourcepub fn get_node_type(&self, name: &str) -> Option<NodeTypeDefinition>
pub fn get_node_type(&self, name: &str) -> Option<NodeTypeDefinition>
Gets a node type definition by name.
Sourcepub fn resolved_node_type(&self, name: &str) -> Option<NodeTypeDefinition>
pub fn resolved_node_type(&self, name: &str) -> Option<NodeTypeDefinition>
Gets a resolved node type with inherited properties and constraints from parents.
Walks the parent chain depth-first, collecting properties and constraints. Detects cycles via a visited set. Child properties override parent ones with the same name.
Sourcepub fn all_node_types(&self) -> Vec<String>
pub fn all_node_types(&self) -> Vec<String>
Returns all registered node type names.
Sourcepub fn all_node_type_defs(&self) -> Vec<NodeTypeDefinition>
pub fn all_node_type_defs(&self) -> Vec<NodeTypeDefinition>
Returns all registered node type definitions.
Sourcepub fn register_edge_type(
&self,
def: EdgeTypeDefinition,
) -> Result<(), CatalogError>
pub fn register_edge_type( &self, def: EdgeTypeDefinition, ) -> Result<(), CatalogError>
Registers a new edge type definition.
§Errors
Returns CatalogError::TypeAlreadyExists if an edge type with the same name exists.
Sourcepub fn register_or_replace_edge_type(&self, def: EdgeTypeDefinition)
pub fn register_or_replace_edge_type(&self, def: EdgeTypeDefinition)
Registers or replaces an edge type definition.
Sourcepub fn drop_edge_type(&self, name: &str) -> Result<(), CatalogError>
pub fn drop_edge_type(&self, name: &str) -> Result<(), CatalogError>
Drops an edge type definition by name.
§Errors
Returns CatalogError::TypeNotFound if no edge type with the given name exists.
Sourcepub fn get_edge_type(&self, name: &str) -> Option<EdgeTypeDefinition>
pub fn get_edge_type(&self, name: &str) -> Option<EdgeTypeDefinition>
Gets an edge type definition by name.
Sourcepub fn all_edge_types(&self) -> Vec<String>
pub fn all_edge_types(&self) -> Vec<String>
Returns all registered edge type names.
Sourcepub fn all_edge_type_defs(&self) -> Vec<EdgeTypeDefinition>
pub fn all_edge_type_defs(&self) -> Vec<EdgeTypeDefinition>
Returns all registered edge type definitions.
Sourcepub fn register_graph_type(
&self,
def: GraphTypeDefinition,
) -> Result<(), CatalogError>
pub fn register_graph_type( &self, def: GraphTypeDefinition, ) -> Result<(), CatalogError>
Registers a new graph type definition.
§Errors
Returns CatalogError::TypeAlreadyExists if a graph type with the same name exists.
Sourcepub fn drop_graph_type(&self, name: &str) -> Result<(), CatalogError>
pub fn drop_graph_type(&self, name: &str) -> Result<(), CatalogError>
Drops a graph type definition by name.
§Errors
Returns CatalogError::TypeNotFound if no graph type with the given name exists.
Sourcepub fn get_graph_type(&self, name: &str) -> Option<GraphTypeDefinition>
pub fn get_graph_type(&self, name: &str) -> Option<GraphTypeDefinition>
Gets a graph type definition by name.
Sourcepub fn all_graph_types(&self) -> Vec<String>
pub fn all_graph_types(&self) -> Vec<String>
Returns all registered graph type names.
Sourcepub fn all_graph_type_defs(&self) -> Vec<GraphTypeDefinition>
pub fn all_graph_type_defs(&self) -> Vec<GraphTypeDefinition>
Returns all registered graph type definitions.
Sourcepub fn register_schema(&self, name: String) -> Result<(), CatalogError>
pub fn register_schema(&self, name: String) -> Result<(), CatalogError>
Registers a schema namespace.
§Errors
Returns CatalogError::SchemaAlreadyExists if the namespace already exists.
Sourcepub fn drop_schema(&self, name: &str) -> Result<(), CatalogError>
pub fn drop_schema(&self, name: &str) -> Result<(), CatalogError>
Drops a schema namespace.
§Errors
Returns CatalogError::SchemaNotFound if the namespace does not exist.
Sourcepub fn schema_exists(&self, name: &str) -> bool
pub fn schema_exists(&self, name: &str) -> bool
Checks whether a schema namespace exists.
Sourcepub fn schema_names(&self) -> Vec<String>
pub fn schema_names(&self) -> Vec<String>
Returns all registered schema namespace names.
Sourcepub fn add_constraint_to_type(
&self,
label: &str,
constraint: TypeConstraint,
) -> Result<(), CatalogError>
pub fn add_constraint_to_type( &self, label: &str, constraint: TypeConstraint, ) -> Result<(), CatalogError>
Adds a constraint to an existing node type, creating a minimal type if needed.
§Errors
Currently infallible, but returns Result for forward compatibility.
Sourcepub fn alter_node_type_add_property(
&self,
type_name: &str,
property: TypedProperty,
) -> Result<(), CatalogError>
pub fn alter_node_type_add_property( &self, type_name: &str, property: TypedProperty, ) -> Result<(), CatalogError>
Adds a property to an existing node type.
§Errors
CatalogError::TypeNotFoundif the node type does not exist.CatalogError::TypeAlreadyExistsif the property already exists on the type.
Sourcepub fn alter_node_type_drop_property(
&self,
type_name: &str,
property_name: &str,
) -> Result<(), CatalogError>
pub fn alter_node_type_drop_property( &self, type_name: &str, property_name: &str, ) -> Result<(), CatalogError>
Drops a property from an existing node type.
§Errors
Returns CatalogError::TypeNotFound if the node type or property does not exist.
Sourcepub fn alter_edge_type_add_property(
&self,
type_name: &str,
property: TypedProperty,
) -> Result<(), CatalogError>
pub fn alter_edge_type_add_property( &self, type_name: &str, property: TypedProperty, ) -> Result<(), CatalogError>
Adds a property to an existing edge type.
§Errors
CatalogError::TypeNotFoundif the edge type does not exist.CatalogError::TypeAlreadyExistsif the property already exists on the type.
Sourcepub fn alter_edge_type_drop_property(
&self,
type_name: &str,
property_name: &str,
) -> Result<(), CatalogError>
pub fn alter_edge_type_drop_property( &self, type_name: &str, property_name: &str, ) -> Result<(), CatalogError>
Drops a property from an existing edge type.
§Errors
Returns CatalogError::TypeNotFound if the edge type or property does not exist.
Sourcepub fn alter_graph_type_add_node_type(
&self,
graph_type_name: &str,
node_type: String,
) -> Result<(), CatalogError>
pub fn alter_graph_type_add_node_type( &self, graph_type_name: &str, node_type: String, ) -> Result<(), CatalogError>
Adds a node type to a graph type.
§Errors
Returns CatalogError::TypeNotFound if the graph type does not exist.
Sourcepub fn alter_graph_type_drop_node_type(
&self,
graph_type_name: &str,
node_type: &str,
) -> Result<(), CatalogError>
pub fn alter_graph_type_drop_node_type( &self, graph_type_name: &str, node_type: &str, ) -> Result<(), CatalogError>
Drops a node type from a graph type.
§Errors
Returns CatalogError::TypeNotFound if the graph type does not exist.
Sourcepub fn alter_graph_type_add_edge_type(
&self,
graph_type_name: &str,
edge_type: String,
) -> Result<(), CatalogError>
pub fn alter_graph_type_add_edge_type( &self, graph_type_name: &str, edge_type: String, ) -> Result<(), CatalogError>
Adds an edge type to a graph type.
§Errors
Returns CatalogError::TypeNotFound if the graph type does not exist.
Sourcepub fn alter_graph_type_drop_edge_type(
&self,
graph_type_name: &str,
edge_type: &str,
) -> Result<(), CatalogError>
pub fn alter_graph_type_drop_edge_type( &self, graph_type_name: &str, edge_type: &str, ) -> Result<(), CatalogError>
Drops an edge type from a graph type.
§Errors
Returns CatalogError::TypeNotFound if the graph type does not exist.
Sourcepub fn register_procedure(
&self,
def: ProcedureDefinition,
) -> Result<(), CatalogError>
pub fn register_procedure( &self, def: ProcedureDefinition, ) -> Result<(), CatalogError>
Registers a stored procedure.
§Errors
Returns CatalogError::TypeAlreadyExists if a procedure with the same name exists.
Sourcepub fn replace_procedure(&self, def: ProcedureDefinition)
pub fn replace_procedure(&self, def: ProcedureDefinition)
Replaces or creates a stored procedure.
Sourcepub fn drop_procedure(&self, name: &str) -> Result<(), CatalogError>
pub fn drop_procedure(&self, name: &str) -> Result<(), CatalogError>
Drops a stored procedure.
§Errors
Returns CatalogError::TypeNotFound if no procedure with the given name exists.
Sourcepub fn get_procedure(&self, name: &str) -> Option<ProcedureDefinition>
pub fn get_procedure(&self, name: &str) -> Option<ProcedureDefinition>
Gets a stored procedure by name.
Sourcepub fn all_procedure_defs(&self) -> Vec<ProcedureDefinition>
pub fn all_procedure_defs(&self) -> Vec<ProcedureDefinition>
Returns all registered procedure definitions.
Sourcepub fn all_graph_type_bindings(&self) -> Vec<(String, String)>
pub fn all_graph_type_bindings(&self) -> Vec<(String, String)>
Returns all graph type bindings (graph_name, type_name).
Auto Trait Implementations§
impl !Freeze for SchemaCatalog
impl !RefUnwindSafe for SchemaCatalog
impl Send for SchemaCatalog
impl Sync for SchemaCatalog
impl Unpin for SchemaCatalog
impl UnsafeUnpin for SchemaCatalog
impl UnwindSafe for SchemaCatalog
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> 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