OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBObject.h File Reference
#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)
 

Enumeration Type Documentation

Enumerator
AbstractDBObjectType 
DatabaseDBObjectType 
TableDBObjectType 
DashboardDBObjectType 
ViewDBObjectType 
ServerDBObjectType 

Definition at line 42 of file DBObject.h.

Function Documentation

DBObjectType DBObjectTypeFromString ( const std::string &  type)

Definition at line 101 of file DBObject.cpp.

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

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

101  {
102  if (type.compare("DATABASE") == 0) {
103  return DatabaseDBObjectType;
104  } else if (type.compare("TABLE") == 0) {
105  return TableDBObjectType;
106  } else if (type.compare("DASHBOARD") == 0) {
107  return DashboardDBObjectType;
108  } else if (type.compare("VIEW") == 0) {
109  return ViewDBObjectType;
110  } else if (type.compare("SERVER") == 0) {
111  return ServerDBObjectType;
112  } else {
113  throw std::runtime_error("DB object type " + type + " is not supported.");
114  }
115 }

+ Here is the caller graph for this function:

std::string DBObjectTypeToString ( DBObjectType  type)

Definition at line 83 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().

83  {
84  switch (type) {
86  return "DATABASE";
87  case TableDBObjectType:
88  return "TABLE";
90  return "DASHBOARD";
91  case ViewDBObjectType:
92  return "VIEW";
93  case ServerDBObjectType:
94  return "SERVER";
95  default:
96  CHECK(false);
97  }
98  return "not possible";
99 }
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the caller graph for this function: