kv & sqlite: db already exists errors

This commit is contained in:
bitful-pannul 2023-12-20 15:42:21 -03:00
parent 77f658e03f
commit 3b48b0cb63
2 changed files with 8 additions and 0 deletions

View File

@ -393,6 +393,10 @@ async fn check_caps(
});
}
if open_kvs.contains_key(&(request.package_id.clone(), request.db.clone())) {
return Err(KvError::DbAlreadyExists);
}
add_capability(
"read",
&request.db.to_string(),

View File

@ -368,6 +368,10 @@ async fn check_caps(
});
}
if open_dbs.contains_key(&(request.package_id.clone(), request.db.clone())) {
return Err(SqliteError::DbAlreadyExists);
}
add_capability(
"read",
&request.db.to_string(),