let manager : CollectionManager[@storage.MemoryStorage] = CollectionManager::new()
let response = execute_path_request(
manager,
"POST",
"/collections/test",
body,
)pub(all) suberror GatewayError {
NotFound(String)
InvalidInput(String)
DimensionMismatch(expected~ : Int, got~ : Int)
CollectionExists(String)
CollectionNotFound(String)
StorageError(String)
}impl Show for GatewayErrorimpl Show for ApiResponseimpl Show for CollectionConfigpub struct CollectionInfo {
name : String
vectors_count : Int
dim : Int
metric : String
strategy : String
}impl Show for CollectionInfopub struct CollectionManager[S] {
collections : Map[String, Collection[S]]
storage : S?
base_path : String
checkpoint_threshold : Int
}async fn[S : AsyncStorage] CollectionManager::checkpoint(self : CollectionManager[S], name : String) -> Unitasync fn[S : AsyncStorage] CollectionManager::create(self : CollectionManager[S], config : CollectionConfig) -> Result[Unit, GatewayError]async fn[S : AsyncStorage] CollectionManager::delete(self : CollectionManager[S], name : String) -> Result[Unit, GatewayError]async fn[S : AsyncStorage] CollectionManager::get(self : CollectionManager[S], name : String) -> Result[PersistentDB[S, S], GatewayError]async fn[S : AsyncStorage] CollectionManager::get_info(self : CollectionManager[S], name : String) -> Result[CollectionInfo, GatewayError]async fn[S : AsyncStorage] CollectionManager::list(self : CollectionManager[S]) -> Result[Array[String], GatewayError]async fn[S : AsyncStorage] CollectionManager::list_info(self : CollectionManager[S]) -> Result[Array[CollectionInfo], GatewayError]fn[S] CollectionManager::load_collection(self : CollectionManager[S], config : CollectionConfig, data : Bytes, storage : S, base_path : String) -> Result[Unit, GatewayError]async fn[S : AsyncStorage] CollectionManager::remove_point(self : CollectionManager[S], name : String, id : VectorId, timestamp_ns? : Int64) -> Result[Unit, GatewayError]async fn[S : AsyncStorage] CollectionManager::upsert_points(self : CollectionManager[S], name : String, points : Array[(VectorId, Array[Double], Attrs)], timestamp_ns? : Int64) -> Result[Int, GatewayError]fn[S] CollectionManager::with_storage(storage : S, base_path? : String, checkpoint_threshold? : Int) -> CollectionManager[S]impl Show for CollectionsResponseimpl Show for PointResponsepub struct ScrollRequest {
offset : Int64?
limit : Int
with_payload : Bool
with_vector : Bool
}impl Show for ScrollRequestimpl Show for SearchHitResponseimpl Show for UpsertRequestasync fn[S : AsyncStorage] execute_path_request(manager : CollectionManager[S], http_method : String, target : String, body : String) -> ApiResponseasync fn[S : AsyncStorage] execute_request(manager : CollectionManager[S], http_method : String, path : Array[String], body : String) -> ApiResponseasync fn[S : AsyncStorage] handle_create_collection(manager : CollectionManager[S], config : CollectionConfig) -> Result[Unit, GatewayError]async fn[S : AsyncStorage] handle_delete_collection(manager : CollectionManager[S], name : String) -> Result[Unit, GatewayError]async fn[S : AsyncStorage] handle_get_collection(manager : CollectionManager[S], name : String) -> Result[CollectionInfo, GatewayError]fn[W, S] handle_get_point(db : PersistentDB[W, S], id : VectorId) -> Result[PointResponse, GatewayError]async fn[S : AsyncStorage] handle_list_collections(manager : CollectionManager[S]) -> Result[CollectionsResponse, GatewayError]fn[W, S] handle_scroll(db : PersistentDB[W, S], req : ScrollRequest) -> Result[ScrollResponse, GatewayError]fn[W, S] handle_search(db : PersistentDB[W, S], req : SearchRequest) -> Result[SearchResponse, GatewayError]fn split_request_target(target : String) -> (String, String)async fn[S : AsyncStorage, T] with_collection(manager : CollectionManager[S], name : String, handler : (PersistentDB[S, S]) -> Result[T, GatewayError]) -> Result[T, GatewayError]Install
Download zipHigh-performance vector database with multiple ANN algorithms