use ares_types::types::{AppError, Result};
#[derive(Debug)]
pub struct ChromaDBStore {
_private: (),
}
impl ChromaDBStore {
pub async fn new(_host: &str) -> Result<Self> {
Err(AppError::Configuration(
"ChromaDBStore is not yet implemented. Use 'ares-vector' (default) or 'qdrant' instead. \
See https://github.com/dirmacs/ares for implementation status.".to_string(),
))
}
}
#[cfg(test)]
mod tests {
use super::*;
use ares_types::types::AppError;
#[tokio::test]
async fn new_returns_configuration_error() {
let err = ChromaDBStore::new("http://localhost:8000")
.await
.unwrap_err();
matches::assert_matches!(err, AppError::Configuration(msg) if {
msg.contains("not yet implemented") && msg.contains("ares-vector")
});
}
#[tokio::test]
async fn new_error_mentions_alternatives() {
let err = ChromaDBStore::new("http://127.0.0.1:8000")
.await
.unwrap_err();
let msg = match err {
AppError::Configuration(m) => m,
other => panic!("expected Configuration, got {other:?}"),
};
assert!(msg.contains("qdrant"), "should suggest qdrant: {msg}");
}
#[tokio::test]
async fn new_ignores_host_but_still_errors() {
for host in ["", "https://chromadb.example", "localhost:8000"] {
let err = ChromaDBStore::new(host).await.unwrap_err();
matches::assert_matches!(err, AppError::Configuration(_));
}
}
}