feat(vector): add Qdrant/Milvus collection dimension display (#2396)
This commit is contained in:
1 parent
0dc83f69b5
commit
24d952dc12
10 files changed
+171
No files matched your search
@@ -442,6 +442,7 @@ async fn main() {
|
||||
// MongoDB
|
||||
.route("/mongo/list-databases", post(routes::mongo::list_databases))
|
||||
.route("/mongo/list-collections", post(routes::mongo::list_collections))
|
||||
.route("/mongo/vector-collection-detail", post(routes::mongo::vector_collection_detail))
|
||||
.route("/mongo/create-database", post(routes::mongo::create_database))
|
||||
.route("/mongo/drop-database", post(routes::mongo::drop_database))
|
||||
.route("/mongo/drop-collection", post(routes::mongo::drop_collection))
|
||||
|
||||
@@ -196,6 +196,29 @@ pub async fn list_collections(
|
||||
Ok(Json(result))
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct VectorCollectionDetailRequest {
|
||||
pub connection_id: String,
|
||||
pub database: String,
|
||||
pub collection: String,
|
||||
}
|
||||
|
||||
pub async fn vector_collection_detail(
|
||||
State(state): State<Arc<WebState>>,
|
||||
Json(req): Json<VectorCollectionDetailRequest>,
|
||||
) -> Result<Json<dbx_core::db::vector_driver::CollectionInfo>, AppError> {
|
||||
let result = dbx_core::schema::get_vector_collection_detail_core(
|
||||
&state.app,
|
||||
&req.connection_id,
|
||||
&req.database,
|
||||
&req.collection,
|
||||
)
|
||||
.await
|
||||
.map_err(AppError)?;
|
||||
Ok(Json(result))
|
||||
}
|
||||
|
||||
pub async fn create_database(
|
||||
State(state): State<Arc<WebState>>,
|
||||
Json(req): Json<MongoCollectionRequest>,
|
||||
|
||||
Reference in new issue
Block a user