This action is irreversible. Proceed with caution.
To delete an exiting encrypted index, you can load it and then call the delete_index() method.
import cyborgdb_core as cyborgdbimport secrets# Using `threadsafememory` storage for this exampleindex_location = cyborgdb.DBConfig("threadsafememory") config_location = cyborgdb.DBConfig("threadsafememory")# Get your API keyapi_key = "your_api_key_here" # Replace with your actual API key# Create a clientclient = cyborgdb.Client( api_key=api_key, index_location=index_location, config_location=config_location)# Provide the index key used when creating the indexindex_key = secrets.token_bytes(32)# Create an encrypted indexindex = client.load_index( index_name="my_index", index_key=index_key)# Delete the indexindex.delete_index()
#include "cyborgdb_core/client.hpp"#include "cyborgdb_core/encrypted_index.hpp"#include <array>// Using `threadsafememory` storage for this examplecyborg::DBConfig index_location(cyborg::Location::kThreadSafeMemory);cyborg::DBConfig config_location(cyborg::Location::kThreadSafeMemory);cyborg::DBConfig contents_location(cyborg::Location::kThreadSafeMemory);// Get your API keystd::string api_key = "your_api_key_here"; // Replace with your actual API key// Create a clientcyborg::Client client(api_key, index_location, config_location, contents_location, 0, cyborg::kNone);// Provide the index key used when creating the index// Example key (32 bytes)std::array<uint8_t, 32> index_key;// Create an encrypted indexauto index = client.LoadIndex("my_index", index_key);// Delete the indexindex->DeleteIndex();