Skip to main content

Drop Store

Deletes an entire store from the database, including all vectors, keys, and associated metadata. This is a destructive operation and cannot be reversedโ€”once a store is dropped, all of its contents are permanently removed.

Source Code Exampleโ€‹

Click to expand
use ahnlich_types::db::query::DropStore;
use ahnlich_client_rs::db::DbClient;


#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Connect to the DB server
let client = DbClient::new("http://127.0.0.1:1369".to_string()).await?;


// Prepare drop store parameters
let drop_params = DropStore {
store: "MyStore".to_string(),
error_if_not_exists: true, // Required field
};


// Execute the drop store request
let result = client.drop_store(drop_params, None).await?;


println!("Deleted count: {}", result.deleted_count);


Ok(())
}

Parametersโ€‹

  • params: DropStore โ€” Identifies the store to be deleted.

  • tracing_id: Option<String> โ€” Optional trace context for observability.

Returnsโ€‹

  • Del โ€” Confirmation that the store was successfully dropped.

  • AhnlichError โ€” If the store does not exist or the operation fails.

Behaviorโ€‹

  • Builds a gRPC request with the DropStore parameters.

  • Attaches tracing metadata if provided.

  • Calls the DB client to drop the specified store and remove all its contents.