pub struct SchemaManager { /* private fields */ }Implementations§
Source§impl SchemaManager
impl SchemaManager
pub async fn load(path: impl AsRef<Path>) -> Result<Self>
pub async fn load_from_store( store: Arc<dyn ObjectStore>, path: &ObjectStorePath, ) -> Result<Self>
pub async fn save(&self) -> Result<()>
pub fn path(&self) -> &ObjectStorePath
pub fn schema(&self) -> Arc<Schema>
Sourcepub fn generated_column_name(expr: &str) -> String
pub fn generated_column_name(expr: &str) -> String
Generate a consistent internal column name for an expression index. Uses a hash suffix to ensure uniqueness for different expressions that might sanitize to the same string (e.g., “a+b” and “a-b” both become “a_b”).
IMPORTANT: Uses FNV-1a hash which is stable across Rust versions and platforms. DefaultHasher is not guaranteed to be stable and could break persistent data if the hash changes after a compiler upgrade.
pub fn replace_schema(&self, new_schema: Schema)
pub fn next_label_id(&self) -> u16
pub fn next_type_id(&self) -> u32
pub fn add_label(&self, name: &str) -> Result<u16>
pub fn add_edge_type( &self, name: &str, src_labels: Vec<String>, dst_labels: Vec<String>, ) -> Result<u32>
Sourcepub fn get_or_assign_edge_type_id(&self, type_name: &str) -> u32
pub fn get_or_assign_edge_type_id(&self, type_name: &str) -> u32
Delegates to Schema::get_or_assign_edge_type_id.
Sourcepub fn edge_type_name_by_id_unified(&self, type_id: u32) -> Option<String>
pub fn edge_type_name_by_id_unified(&self, type_id: u32) -> Option<String>
Delegates to Schema::edge_type_name_by_id_unified.
pub fn add_property( &self, label_or_type: &str, prop_name: &str, data_type: DataType, nullable: bool, ) -> Result<()>
pub fn add_generated_property( &self, label_or_type: &str, prop_name: &str, data_type: DataType, expr: String, ) -> Result<()>
pub fn add_index(&self, index_def: IndexDefinition) -> Result<()>
pub fn get_index(&self, name: &str) -> Option<IndexDefinition>
pub fn remove_index(&self, name: &str) -> Result<()>
pub fn add_constraint(&self, constraint: Constraint) -> Result<()>
pub fn drop_constraint(&self, name: &str, if_exists: bool) -> Result<()>
pub fn drop_property(&self, label_or_type: &str, prop_name: &str) -> Result<()>
pub fn rename_property( &self, label_or_type: &str, old_name: &str, new_name: &str, ) -> Result<()>
pub fn drop_label(&self, name: &str, if_exists: bool) -> Result<()>
pub fn drop_edge_type(&self, name: &str, if_exists: bool) -> Result<()>
Auto Trait Implementations§
impl !Freeze for SchemaManager
impl !RefUnwindSafe for SchemaManager
impl Send for SchemaManager
impl Sync for SchemaManager
impl Unpin for SchemaManager
impl UnsafeUnpin for SchemaManager
impl !UnwindSafe for SchemaManager
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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