OmniSciDB  eb3a3d0a03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser::ValidateStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::ValidateStmt:
+ Collaboration diagram for Parser::ValidateStmt:

Public Member Functions

 ValidateStmt (std::string *type, std::list< NameValueAssign * > *with_opts)
 
 ValidateStmt (const rapidjson::Value &payload)
 
bool isRepairTypeRemove () const
 
const std::string getType () const
 
void execute (const Catalog_Namespace::SessionInfo &session) override
 
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Private Attributes

std::unique_ptr< std::string > type_
 
bool isRepairTypeRemove_ = false
 

Detailed Description

Definition at line 1264 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::ValidateStmt::ValidateStmt ( std::string *  type,
std::list< NameValueAssign * > *  with_opts 
)

Definition at line 3976 of file ParserNode.cpp.

References isRepairTypeRemove_, and Parser::repair_type().

3977  : type_(type) {
3978  if (!type) {
3979  throw std::runtime_error("Validation Type is required for VALIDATE command.");
3980  }
3981  std::list<std::unique_ptr<NameValueAssign>> options;
3982  if (with_opts) {
3983  for (const auto e : *with_opts) {
3984  options.emplace_back(e);
3985  }
3986  delete with_opts;
3987 
3988  isRepairTypeRemove_ = repair_type(options);
3989  }
3990 }
bool repair_type(std::list< std::unique_ptr< NameValueAssign >> &options)
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1276

+ Here is the call graph for this function:

Parser::ValidateStmt::ValidateStmt ( const rapidjson::Value &  payload)

Definition at line 3992 of file ParserNode.cpp.

References CHECK, isRepairTypeRemove_, json_str(), Parser::anonymous_namespace{ParserNode.cpp}::parse_options(), Parser::repair_type(), and type_.

3992  {
3993  CHECK(payload.HasMember("type"));
3994  type_ = std::make_unique<std::string>(json_str(payload["type"]));
3995 
3996  std::list<std::unique_ptr<NameValueAssign>> options;
3997  parse_options(payload, options);
3998 
3999  isRepairTypeRemove_ = repair_type(options);
4000 }
bool repair_type(std::list< std::unique_ptr< NameValueAssign >> &options)
const std::string json_str(const rapidjson::Value &obj) noexcept
Definition: JsonAccessors.h:44
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1276
void parse_options(const rapidjson::Value &payload, std::list< std::unique_ptr< NameValueAssign >> &nameValueList, bool stringToNull=false, bool stringToInteger=false)
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

Member Function Documentation

void Parser::ValidateStmt::execute ( const Catalog_Namespace::SessionInfo session)
inlineoverridevirtual

Implements Parser::DDLStmt.

Definition at line 1273 of file ParserNode.h.

References UNREACHABLE.

Referenced by omnisci.cursor.Cursor::executemany().

1273 { UNREACHABLE(); }
#define UNREACHABLE()
Definition: Logger.h:253

+ Here is the caller graph for this function:

const std::string Parser::ValidateStmt::getType ( ) const
inline

Definition at line 1271 of file ParserNode.h.

References type_.

1271 { return *(type_.get()); }
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1276
bool Parser::ValidateStmt::isRepairTypeRemove ( ) const
inline

Definition at line 1269 of file ParserNode.h.

References isRepairTypeRemove_.

1269 { return isRepairTypeRemove_; }

Member Data Documentation

bool Parser::ValidateStmt::isRepairTypeRemove_ = false
private

Definition at line 1277 of file ParserNode.h.

Referenced by isRepairTypeRemove(), and ValidateStmt().

std::unique_ptr<std::string> Parser::ValidateStmt::type_
private

Definition at line 1276 of file ParserNode.h.

Referenced by getType(), and ValidateStmt().


The documentation for this class was generated from the following files: