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

#include <ParserNode.h>

+ Inheritance diagram for Parser::DumpTableStmt:
+ Collaboration diagram for Parser::DumpTableStmt:

Public Member Functions

 DumpTableStmt (std::string *tab, std::string *path, std::list< NameValueAssign * > *options)
 
 DumpTableStmt (const rapidjson::Value &payload)
 
void execute (const Catalog_Namespace::SessionInfo &session) override
 
- Public Member Functions inherited from Parser::DumpRestoreTableStmtBase
 DumpRestoreTableStmtBase (std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
 
 DumpRestoreTableStmtBase (const rapidjson::Value &payload, const bool is_restore)
 
void validateCompression (std::string &compression, const bool is_restore)
 
const std::string * getTable () const
 
const std::string * getPath () const
 
const std::string getCompression () const
 
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Additional Inherited Members

- Protected Attributes inherited from Parser::DumpRestoreTableStmtBase
std::unique_ptr< std::string > table_
 
std::unique_ptr< std::string > path_
 
std::string compression_
 

Detailed Description

Definition at line 1446 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::DumpTableStmt::DumpTableStmt ( std::string *  tab,
std::string *  path,
std::list< NameValueAssign * > *  options 
)
inline

Definition at line 1448 of file ParserNode.h.

1449  : DumpRestoreTableStmtBase(tab, path, options, false) {}
DumpRestoreTableStmtBase(std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
Definition: ParserNode.h:1394
Parser::DumpTableStmt::DumpTableStmt ( const rapidjson::Value &  payload)

Definition at line 6258 of file ParserNode.cpp.

6259  : DumpRestoreTableStmtBase(payload, false) {}
DumpRestoreTableStmtBase(std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
Definition: ParserNode.h:1394

Member Function Documentation

void Parser::DumpTableStmt::execute ( const Catalog_Namespace::SessionInfo session)
overridevirtual

Implements Parser::DDLStmt.

Definition at line 6261 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::checkDBAccessPrivileges(), Parser::DumpRestoreTableStmtBase::compression_, AccessPrivileges::CREATE_TABLE, TableArchiver::dumpTable(), Catalog_Namespace::SessionInfo::getCatalog(), Parser::DumpRestoreTableStmtBase::path_, AccessPrivileges::SELECT_FROM_TABLE, Parser::DumpRestoreTableStmtBase::table_, and TableDBObjectType.

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

6261  {
6262  // check access privileges
6265  *table_)) {
6266  throw std::runtime_error("Table " + *table_ +
6267  " will not be dumped. User has no select privileges.");
6268  }
6271  throw std::runtime_error("Table " + *table_ +
6272  " will not be dumped. User has no create privileges.");
6273  }
6274  auto& catalog = session.getCatalog();
6275  const TableDescriptor* td = catalog.getMetadataForTable(*table_);
6276  TableArchiver table_archiver(&catalog);
6277  table_archiver.dumpTable(td, *path_, compression_);
6278 }
static const AccessPrivileges SELECT_FROM_TABLE
Definition: DBObject.h:162
std::unique_ptr< std::string > table_
Definition: ParserNode.h:1441
static const AccessPrivileges CREATE_TABLE
Definition: DBObject.h:160
std::unique_ptr< std::string > path_
Definition: ParserNode.h:1442
Catalog & getCatalog() const
Definition: SessionInfo.h:67
bool checkDBAccessPrivileges(const DBObjectType &permissionType, const AccessPrivileges &privs, const std::string &objectName="") const
Definition: SessionInfo.cpp:24

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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