MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / create_index

Method create_index

graphlite/src/storage/indexes/manager.rs:36–58  ·  view source on GitHub ↗

Create a new index

(
        &self,
        name: String,
        _index_type: super::IndexType,
        _config: super::IndexConfig,
    )

Source from the content-addressed store, hash-verified

34
35 /// Create a new index
36 pub async fn create_index(
37 &self,
38 name: String,
39 _index_type: super::IndexType,
40 _config: super::IndexConfig,
41 ) -> Result<(), IndexError> {
42 info!("Creating index '{}'", name);
43
44 let mut index_names = self
45 .index_names
46 .write()
47 .map_err(|e| IndexError::creation(format!("Failed to acquire lock: {}", e)))?;
48
49 if index_names.contains(&name) {
50 return Err(IndexError::AlreadyExists(name));
51 }
52
53 // Store index name
54 index_names.insert(name.clone());
55
56 debug!("Index '{}' created successfully", name);
57 Ok(())
58 }
59
60 /// Delete an index
61 pub async fn delete_index(&self, name: &str) -> Result<(), IndexError> {

Callers 1

execute_ddl_operationMethod · 0.80

Calls 3

containsMethod · 0.80
cloneMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected