GPUdb C++ API  Version 5.2.0.0
gpudb::CreateTableRequest Struct Reference

A set of input parameters for createTable(const CreateTableRequest&) const. More...

#include <gpudb/protocol/create_table.h>

Public Member Functions

 CreateTableRequest ()
 Constructs a CreateTableRequest object with default parameter values. More...
 
 CreateTableRequest (const std::string &tableName, const std::string &typeId, const std::map< std::string, std::string > &options)
 Constructs a CreateTableRequest object with the specified parameters. More...
 

Public Attributes

std::string tableName
 
std::string typeId
 
std::map< std::string, std::string > options
 

Detailed Description

A set of input parameters for createTable(const CreateTableRequest&) const.

Creates a new table or collection in GPUdb. If a new table is being created then type of the table is given by typeId which must the be the type id of a currently registered type (i.e. one created via createType(const CreateTypeRequest&) const). The table will be created inside a collection if the option collection_name is specified. If that collection does not already exist then it will be created. To create a new, empty collection specify the collection name in tableName, leave typeId blank, and set the is_collection option to 'true'.

Definition at line 26 of file create_table.h.

Constructor & Destructor Documentation

gpudb::CreateTableRequest::CreateTableRequest ( )
inline

Constructs a CreateTableRequest object with default parameter values.

Definition at line 33 of file create_table.h.

gpudb::CreateTableRequest::CreateTableRequest ( const std::string &  tableName,
const std::string &  typeId,
const std::map< std::string, std::string > &  options 
)
inline

Constructs a CreateTableRequest object with the specified parameters.

Parameters
[in]tableNameName of the table to be created. Must not be the name of a currently existing GPUdb table of a different type. Error for requests with existing table of the same name and type id may be suppressed by using the no_error_if_exists option. Cannot be an empty string. Valid characters are 'A-Za-z0-9_-(){}[] .:' (excluding the single quote), with the first character being one of 'A-Za-z0-9_'. The maximum length is 256 characters.
[in]typeIdID of a currently registered type in GPUdb. All objects added to the newly created table will be of this type. Must be an empty string if the is_collection is 'true'.
[in]optionsOptional parameters.
  • no_error_if_exists: If true, prevents an error from occurring if the table already exists and is of the given type. If a table with the same ID but a different type exists, it is still an error. Values: 'true', 'false'.
  • collection_name: Name of a collection in GPUdb to which the newly created table is to be assigned as a child table. If empty, then the newly created table will be a top level table. If the collection does not allow duplicate children, then this table creation request will fail if there is an existing child table with the same type id specified in this request.
  • is_collection: Indicates whether the new table to be created will be a collection. If false, the created table will be a top level table. Values: 'true', 'false'.
  • disallow_homogeneous_tables: For a collection, indicates whether multiple children of exactly the same data type will be allowed. Values: 'true', 'false'.
  • is_replicated: For a Table, this is an indication to GPUdb to replicate the table to all the ranks. This is only required when the table will be used to join with other tables in a query. Values: 'true', 'false'.
  • foreign_keys: Semicolon-separated list of foreign key constraints, of the format 'my_field references primary_table(primary_key_field)'.
Default value is an empty std::map.

Definition at line 97 of file create_table.h.

Member Data Documentation

std::map<std::string, std::string> gpudb::CreateTableRequest::options

Definition at line 106 of file create_table.h.

std::string gpudb::CreateTableRequest::tableName

Definition at line 104 of file create_table.h.

std::string gpudb::CreateTableRequest::typeId

Definition at line 105 of file create_table.h.


The documentation for this struct was generated from the following file: