use topodb::workload::{batches, WorkloadSpec};
use topodb::{Db, IndexSpec, NodeId, Op, PropIndex};
fn memory_id(i: usize) -> NodeId {
NodeId::from_u128(0x0100_0000_0000_0000_0000_0000_0000_0000 | i as u128)
}
#[test]
#[ignore]
fn generate_v3_workload_fixture() {
let path =
std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/v3-workload.redb");
let _ = std::fs::remove_file(&path);
let spec = IndexSpec {
equality: vec![PropIndex {
label: "Entity".into(),
prop: "name".into(),
}],
text: vec![PropIndex {
label: "Memory".into(),
prop: "content".into(),
}],
};
let db = Db::open_with(&path, spec).unwrap();
for batch in batches(&WorkloadSpec {
memories: 200,
embed_pct: 40,
..Default::default()
}) {
db.submit(batch).unwrap();
}
db.submit(vec![Op::SetEmbedding {
id: memory_id(0),
model: "bench-384".into(),
vector: vec![0.25; 384],
}])
.unwrap();
}