OmniSciDB  a987f07e93
 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 4592 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().

4592  {
4593  if (is_info_schema_db(db_name)) {
4594  std::string error_message{"Write requests/queries are not allowed in the " +
4595  shared::kInfoSchemaDbName + " database."};
4596  if (throw_db_exception) {
4597  THROW_DB_EXCEPTION(error_message)
4598  } else {
4599  throw std::runtime_error(error_message);
4600  }
4601  }
4602 }
const std::string kInfoSchemaDbName
bool is_info_schema_db(const std::string &db_name)
Definition: DBHandler.cpp:4587
#define THROW_DB_EXCEPTION(errstr)
Definition: DBHandler.cpp:136

+ 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 4587 of file DBHandler.cpp.

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

Referenced by check_not_info_schema_db().

4587  {
4588  return (db_name == shared::kInfoSchemaDbName &&
4589  SysCatalog::instance().hasExecutedMigration(shared::kInfoSchemaMigrationName));
4590 }
const std::string kInfoSchemaDbName
const std::string kInfoSchemaMigrationName

+ Here is the caller graph for this function: