OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dbhandler Namespace Reference

Functions

bool is_info_schema_db (const std::string &db_name)
 
void check_not_info_schema_db (const std::string &db_name, bool throw_db_exception)
 

Function Documentation

void dbhandler::check_not_info_schema_db ( const std::string &  db_name,
bool  throw_db_exception 
)

Definition at line 4809 of file DBHandler.cpp.

References is_info_schema_db(), shared::kInfoSchemaDbName, and THROW_DB_EXCEPTION.

Referenced by DBHandler::create_dashboard(), DBHandler::delete_dashboards(), DBHandler::replace_dashboard(), and DBHandler::sql_execute_impl().

4809  {
4810  if (is_info_schema_db(db_name)) {
4811  std::string error_message{"Write requests/queries are not allowed in the " +
4812  shared::kInfoSchemaDbName + " database."};
4813  if (throw_db_exception) {
4814  THROW_DB_EXCEPTION(error_message)
4815  } else {
4816  throw std::runtime_error(error_message);
4817  }
4818  }
4819 }
const std::string kInfoSchemaDbName
bool is_info_schema_db(const std::string &db_name)
Definition: DBHandler.cpp:4804
#define THROW_DB_EXCEPTION(errstr)
Definition: DBHandler.cpp:139

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool dbhandler::is_info_schema_db ( const std::string &  db_name)

Definition at line 4804 of file DBHandler.cpp.

References shared::kInfoSchemaDbName, and shared::kInfoSchemaMigrationName.

Referenced by check_not_info_schema_db().

4804  {
4805  return (db_name == shared::kInfoSchemaDbName &&
4806  SysCatalog::instance().hasExecutedMigration(shared::kInfoSchemaMigrationName));
4807 }
const std::string kInfoSchemaDbName
const std::string kInfoSchemaMigrationName

+ Here is the caller graph for this function: