Support removed vertices in the triggers (#140)

This commit is contained in:
antonio2368
2021-05-04 13:00:07 +02:00
committed by Antonio Andelic
parent 2f3fa656d9
commit 11c0dde11c
14 changed files with 245 additions and 103 deletions

View File

@@ -246,8 +246,18 @@ class DbAccessor final {
return accessor_->DetachDeleteVertex(&vertex_accessor->impl_);
}
storage::Result<bool> RemoveVertex(VertexAccessor *vertex_accessor) {
return accessor_->DeleteVertex(&vertex_accessor->impl_);
storage::Result<std::optional<VertexAccessor>> RemoveVertex(VertexAccessor *vertex_accessor) {
auto res = accessor_->DeleteVertex(&vertex_accessor->impl_);
if (res.HasError()) {
return res.GetError();
}
const auto &value = res.GetValue();
if (!value) {
return std::optional<VertexAccessor>{};
}
return std::make_optional<VertexAccessor>(*value);
}
storage::PropertyId NameToProperty(const std::string_view &name) { return accessor_->NameToProperty(name); }