OmniSciDB  04ee39c94c
Catalog_Namespace Namespace Reference

Namespaces

 anonymous_namespace{Catalog.cpp}
 
 anonymous_namespace{SysCatalog.cpp}
 

Classes

class  Catalog
 class for a per-database catalog. also includes metadata for the current database and the current user. More...
 
class  CommonFileOperations
 
struct  DBMetadata
 
struct  DBSummary
 
class  MapDHandler
 
class  read_lock
 
class  SessionInfo
 
class  sqlite_lock
 
class  SysCatalog
 
struct  UserMetadata
 
class  write_lock
 

Typedefs

using cat_read_lock = read_lock< Catalog >
 
using cat_write_lock = write_lock< Catalog >
 
using cat_sqlite_lock = sqlite_lock< Catalog >
 
using sys_read_lock = read_lock< SysCatalog >
 
using sys_write_lock = write_lock< SysCatalog >
 
using sys_sqlite_lock = sqlite_lock< SysCatalog >
 
using DBSummaryList = std::list< DBSummary >
 

Functions

std::ostream & operator<< (std::ostream &os, const SessionInfo &session_info)
 
void deleteObjectPrivileges (std::unique_ptr< SqliteConnector > &sqliteConnector, std::string roleName, bool userRole, DBObject &object)
 
void insertOrUpdateObjectPrivileges (std::unique_ptr< SqliteConnector > &sqliteConnector, std::string roleName, bool userRole, DBObject &object)
 

Variables

const int DEFAULT_INITIAL_VERSION = 1
 
const int MAPD_TEMP_TABLE_START_ID
 
const int MAPD_TEMP_DICT_START_ID
 

Typedef Documentation

◆ cat_read_lock

Definition at line 88 of file Catalog.cpp.

◆ cat_sqlite_lock

Definition at line 90 of file Catalog.cpp.

◆ cat_write_lock

Definition at line 89 of file Catalog.cpp.

◆ DBSummaryList

using Catalog_Namespace::DBSummaryList = typedef std::list<DBSummary>

Definition at line 106 of file SysCatalog.h.

◆ sys_read_lock

Definition at line 74 of file SysCatalog.cpp.

◆ sys_sqlite_lock

Definition at line 76 of file SysCatalog.cpp.

◆ sys_write_lock

Definition at line 75 of file SysCatalog.cpp.

Function Documentation

◆ deleteObjectPrivileges()

void Catalog_Namespace::deleteObjectPrivileges ( std::unique_ptr< SqliteConnector > &  sqliteConnector,
std::string  roleName,
bool  userRole,
DBObject object 
)

Definition at line 315 of file SysCatalog.cpp.

References DBObjectKey::dbId, DBObjectKey::objectId, DBObjectKey::permissionType, and to_string().

Referenced by Catalog_Namespace::SysCatalog::revokeDBObjectPrivileges_unsafe().

318  {
319  DBObjectKey key = object.getObjectKey();
320 
321  sqliteConnector->query_with_text_params(
322  "DELETE FROM mapd_object_permissions WHERE roleName = ?1 and roleType = ?2 and "
323  "objectPermissionsType = ?3 and "
324  "dbId = "
325  "?4 "
326  "and objectId = ?5",
327  std::vector<std::string>{roleName,
328  std::to_string(userRole),
330  std::to_string(key.dbId),
331  std::to_string(key.objectId)});
332 }
int32_t objectId
Definition: DBObject.h:56
std::string to_string(char const *&&v)
int32_t dbId
Definition: DBObject.h:55
int32_t permissionType
Definition: DBObject.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertOrUpdateObjectPrivileges()

void Catalog_Namespace::insertOrUpdateObjectPrivileges ( std::unique_ptr< SqliteConnector > &  sqliteConnector,
std::string  roleName,
bool  userRole,
DBObject object 
)

Definition at line 334 of file SysCatalog.cpp.

References DBObjectKey::dbId, DBObjectKey::objectId, DBObjectKey::permissionType, and to_string().

Referenced by Catalog_Namespace::SysCatalog::createRole_unsafe(), Catalog_Namespace::SysCatalog::grantDBObjectPrivileges_unsafe(), Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges(), Catalog_Namespace::SysCatalog::migratePrivileges(), Catalog_Namespace::SysCatalog::populateRoleDbObjects(), and Catalog_Namespace::SysCatalog::revokeDBObjectPrivileges_unsafe().

337  {
338  DBObjectKey key = object.getObjectKey();
339 
340  sqliteConnector->query_with_text_params(
341  "INSERT OR REPLACE INTO mapd_object_permissions("
342  "roleName, "
343  "roleType, "
344  "objectPermissionsType, "
345  "dbId, "
346  "objectId, "
347  "objectPermissions, "
348  "objectOwnerId,"
349  "objectName) "
350  "VALUES (?1, ?2, ?3, "
351  "?4, ?5, ?6, ?7, ?8)",
352  std::vector<std::string>{
353  roleName, // roleName
354  userRole ? "1" : "0", // roleType
355  std::to_string(key.permissionType), // permissionType
356  std::to_string(key.dbId), // dbId
357  std::to_string(key.objectId), // objectId
358  std::to_string(object.getPrivileges().privileges), // objectPrivileges
359  std::to_string(object.getOwner()), // objectOwnerId
360  object.getName() // name
361  });
362 }
int32_t objectId
Definition: DBObject.h:56
std::string to_string(char const *&&v)
int32_t dbId
Definition: DBObject.h:55
int32_t permissionType
Definition: DBObject.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<<()

std::ostream & Catalog_Namespace::operator<< ( std::ostream &  os,
const SessionInfo session_info 
)

Definition at line 53 of file SessionInfo.cpp.

References Catalog_Namespace::SessionInfo::get_public_session_id().

53  {
54  os << session_info.get_public_session_id();
55  return os;
56 }
+ Here is the call graph for this function:

Variable Documentation

◆ DEFAULT_INITIAL_VERSION

const int Catalog_Namespace::DEFAULT_INITIAL_VERSION = 1

Definition at line 77 of file Catalog.cpp.

◆ MAPD_TEMP_DICT_START_ID

const int Catalog_Namespace::MAPD_TEMP_DICT_START_ID
Initial value:
=
1073741824

Definition at line 80 of file Catalog.cpp.

◆ MAPD_TEMP_TABLE_START_ID

const int Catalog_Namespace::MAPD_TEMP_TABLE_START_ID
Initial value:
=
1073741824

Definition at line 78 of file Catalog.cpp.