vectordb-client
A Rust client library for interacting with the VectorDB semantic code search service.
Features
- Easy connection to VectorDB servers
- Full API coverage for all VectorDB operations
- Type-safe API with proper error handling
- TLS support for secure connections
- API key authentication
- Code editing with semantic understanding
Usage
Add the dependency to your Cargo.toml:
[]
= "0.1.0"
= { = "1.0", = ["full"] }
Basic Example
use VectorDBClient;
use Error;
async
Custom Configuration
use ;
use Error;
async
Code Editing Example
use VectorDBClient;
use Error;
async
API Documentation
The client provides methods for all VectorDB operations:
Server Operations
get_server_info()- Get information about the server
Collection Management
create_collection(name, vector_size, distance)- Create a new collectionlist_collections()- List all collectionsdelete_collection(name)- Delete a collectionclear_collection(name)- Clear a collection
Indexing and Searching
index_files(collection_name, paths, extensions)- Index files into a collectionquery_collection(collection_name, query_text, limit, language, element_type)- Search a collection
Repository Management
add_repository(url, local_path, name, branch, remote, ssh_key_path, ssh_passphrase)- Add a Git repositorylist_repositories()- List all repositoriesuse_repository(name)- Set the active repositoryremove_repository(name, skip_confirmation)- Remove a repositorysync_repository(name, extensions, force)- Sync a repositoryuse_branch(branch_name, repository_name)- Set the active branch
Code Editing
edit_file_by_lines(file_path, start_line, end_line, content, format, update_references)- Edit a file by line rangeedit_file_by_element(file_path, element_query, content, format, update_references)- Edit a semantic elementvalidate_edit_by_lines(file_path, start_line, end_line, content, format, update_references)- Validate a line editvalidate_edit_by_element(file_path, element_query, content, format, update_references)- Validate an element edit
Element Query Syntax
When targeting semantic elements, use the following syntax:
function:name- Target a functionclass:ClassName- Target a classmethod:ClassName.method_name- Target a class methodstruct:StructName- Target a struct (Rust)impl:StructName- Target an implementation block (Rust)
License
This project is licensed under the MIT License.