feat(db): impl has_group

Former-commit-id: 785fb73b07ef58017a6e1f04cd2f997f43f89b88
This commit is contained in:
Xu Peng 2019-04-18 10:02:12 +08:00
parent 92e30f4e7a
commit a8a1d3abcd

View File

@ -91,8 +91,15 @@ Status DBMetaImpl::get_group(GroupSchema& group_info) {
return Status::OK();
}
Status DBMetaImpl::has_group(const std::string& group_id_, bool& has_or_not_) {
//PXU TODO
Status DBMetaImpl::has_group(const std::string& group_id, bool& has_or_not) {
auto groups = ConnectorPtr->select(columns(&GroupSchema::id),
where(c(&GroupSchema::group_id) == group_id));
assert(groups.size() <= 1);
if (groups.size() == 1) {
has_or_not = true;
} else {
has_or_not = false;
}
return Status::OK();
}