OmniSciDB  ca0c39ec8f
 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 4440 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().

4440  {
4441  if (is_info_schema_db(db_name)) {
4442  std::string error_message{"Write requests/queries are not allowed in the " +
4443  shared::kInfoSchemaDbName + " database."};
4444  if (throw_db_exception) {
4445  THROW_DB_EXCEPTION(error_message)
4446  } else {
4447  throw std::runtime_error(error_message);
4448  }
4449  }
4450 }
const std::string kInfoSchemaDbName
bool is_info_schema_db(const std::string &db_name)
Definition: DBHandler.cpp:4435
#define THROW_DB_EXCEPTION(errstr)
Definition: DBHandler.cpp:128

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

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

Referenced by check_not_info_schema_db().

4435  {
4436  return (db_name == shared::kInfoSchemaDbName &&
4437  SysCatalog::instance().hasExecutedMigration(shared::kInfoSchemaMigrationName));
4438 }
const std::string kInfoSchemaDbName
const std::string kInfoSchemaMigrationName

+ Here is the caller graph for this function: