OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBObject.h File Reference

Class specification and related data structures for DBObject class. More...

#include <string>
#include <unordered_set>
#include "Logger/Logger.h"
+ Include dependency graph for DBObject.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DBObjectKey
 
struct  DatabasePrivileges
 
struct  TablePrivileges
 
struct  DashboardPrivileges
 
struct  ViewPrivileges
 
struct  ServerPrivileges
 
struct  AccessPrivileges
 
class  DBObject
 

Namespaces

 Catalog_Namespace
 

Enumerations

enum  DBObjectType {
  AbstractDBObjectType = 0, DatabaseDBObjectType, TableDBObjectType, DashboardDBObjectType,
  ViewDBObjectType, ServerDBObjectType
}
 

Functions

std::string DBObjectTypeToString (DBObjectType type)
 
DBObjectType DBObjectTypeFromString (const std::string &type)
 

Detailed Description

Class specification and related data structures for DBObject class.

To support access privileges of DB users to DB entities (tables, columns, views, etc), the users are granted roles and included in the corresponding object of the Role class, and DB entities are being described as objects of DBObjects class

Definition in file DBObject.h.

Enumeration Type Documentation

Enumerator
AbstractDBObjectType 
DatabaseDBObjectType 
TableDBObjectType 
DashboardDBObjectType 
ViewDBObjectType 
ServerDBObjectType 

Definition at line 40 of file DBObject.h.

Function Documentation

DBObjectType DBObjectTypeFromString ( const std::string &  type)

Definition at line 110 of file DBObject.cpp.

References DashboardDBObjectType, DatabaseDBObjectType, ServerDBObjectType, TableDBObjectType, and ViewDBObjectType.

Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().

110  {
111  if (type.compare("DATABASE") == 0) {
112  return DatabaseDBObjectType;
113  } else if (type.compare("TABLE") == 0) {
114  return TableDBObjectType;
115  } else if (type.compare("DASHBOARD") == 0) {
116  return DashboardDBObjectType;
117  } else if (type.compare("VIEW") == 0) {
118  return ViewDBObjectType;
119  } else if (type.compare("SERVER") == 0) {
120  return ServerDBObjectType;
121  } else {
122  throw std::runtime_error("DB object type " + type + " is not supported.");
123  }
124 }

+ Here is the caller graph for this function:

std::string DBObjectTypeToString ( DBObjectType  type)

Definition at line 92 of file DBObject.cpp.

References CHECK, DashboardDBObjectType, DatabaseDBObjectType, ServerDBObjectType, TableDBObjectType, and ViewDBObjectType.

Referenced by Catalog_Namespace::anonymous_namespace{Catalog.cpp}::convert_object_owners_map_to_string(), and Parser::verifyObject().

92  {
93  switch (type) {
95  return "DATABASE";
96  case TableDBObjectType:
97  return "TABLE";
99  return "DASHBOARD";
100  case ViewDBObjectType:
101  return "VIEW";
102  case ServerDBObjectType:
103  return "SERVER";
104  default:
105  CHECK(false);
106  }
107  return "not possible";
108 }
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the caller graph for this function: