Skip to content

Commit d28918b

Browse files
committed
[ENH]: (Rust client): fix database resolution
1 parent 2fcde02 commit d28918b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use serde::{Deserialize, Serialize};
2+
use std::collections::HashSet;
23

34
#[derive(Serialize, Deserialize, Debug)]
45
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
56
pub struct GetUserIdentityResponse {
67
pub user_id: String,
78
pub tenant: String,
8-
pub databases: Vec<String>,
9+
pub databases: HashSet<String>,
910
}

rust/chroma/src/client/chroma_http_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl ChromaHttpClient {
349349
));
350350
}
351351

352-
let database_name = identity.databases.first().ok_or_else(|| {
352+
let database_name = identity.databases.into_iter().next().ok_or_else(|| {
353353
ChromaClientError::CouldNotResolveDatabaseId(
354354
"Client has access to no databases".to_string(),
355355
)

0 commit comments

Comments
 (0)