Skip to content

Commit 907c680

Browse files
committed
Update readme and remove db check
1 parent 3b2a9c9 commit 907c680

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ The library reference can be found [here](https://docs.rs/chromadb).
2626
#### You can connect to ChromaDB by instantiating a [ChromaClient](https://docs.rs/chromadb/latest/chromadb/v1/client/struct.ChromaClient.html)
2727

2828
```rust
29-
use chromadb::v2::client::{ChromaAuthMethod, ChromaClient, ChromaClientOptions, ChromaTokenHeader};
30-
use chromadb::v2::collection::{ChromaCollection, GetQuery, GetResult, CollectionEntries};
29+
use chromadb::client::{ChromaAuthMethod, ChromaClient, ChromaClientOptions, ChromaTokenHeader};
30+
use chromadb::collection::{ChromaCollection, GetQuery, GetResult, CollectionEntries};
3131

3232
// With default ChromaClientOptions
3333
// Defaults to http://localhost:8000
@@ -39,8 +39,8 @@ let auth = ChromaAuthMethod::TokenAuth {
3939
header: ChromaTokenHeader::Authorization
4040
};
4141
let client: ChromaClient = ChromaClient::new(ChromaClientOptions {
42-
url: "<CHROMADB_URL>".into(),
43-
database: Some("<DATABASE>".into()),
42+
url: Some("<CHROMADB_URL>".into()),
43+
database: "<DATABASE>".into(),
4444
auth
4545
});
4646
```

src/api.rs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub(super) struct APIClientAsync {
4545
#[derive(serde::Deserialize)]
4646
pub(crate) struct UserIdentity {
4747
pub tenant: String,
48+
#[allow(dead_code)]
4849
pub databases: Vec<String>,
4950
}
5051

src/client.rs

-8
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ impl ChromaClient {
5555
.unwrap_or(std::env::var("CHROMA_URL").unwrap_or(DEFAULT_ENDPOINT.to_string()))
5656
};
5757
let user_identity = APIClientAsync::get_auth(&endpoint, &auth).await?;
58-
if user_identity.databases.iter().all(|db| db != &database)
59-
&& !matches!(auth, ChromaAuthMethod::None)
60-
{
61-
return Err(anyhow::anyhow!(
62-
"Database {} not found in user's databases",
63-
database
64-
));
65-
}
6658
Ok(ChromaClient {
6759
api: Arc::new(APIClientAsync::new(
6860
endpoint,

0 commit comments

Comments
 (0)