fix tablestore namespacing

This commit is contained in:
Christien Rioux 2024-03-03 21:58:27 -05:00
parent 9aa95f6857
commit 728038c197

View File

@ -17,7 +17,15 @@ impl TableStoreDriver {
let tablestoredir = c.table_store.directory.clone();
std::fs::create_dir_all(&tablestoredir).map_err(VeilidAPIError::from)?;
let dbpath: PathBuf = [tablestoredir, String::from(table)].iter().collect();
let c = self.config.get();
let namespace = c.namespace.clone();
let dbpath: PathBuf = if namespace.is_empty() {
[tablestoredir, String::from(table)].iter().collect()
} else {
[tablestoredir, format!("{}_{}", namespace, table)]
.iter()
.collect()
};
Ok(dbpath)
}