Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::CreateTableInfo Struct Reference
Inheritance diagram for duckdb::CreateTableInfo:
Collaboration diagram for duckdb::CreateTableInfo:

Public Member Functions

DUCKDB_API CreateTableInfo (string catalog, string schema, string name)
DUCKDB_API CreateTableInfo (SchemaCatalogEntry &schema, string name)
DUCKDB_API unique_ptr< CreateInfo > Copy () const override
DUCKDB_API void Serialize (Serializer &serializer) const override
string ExtraOptionsToString () const
string ToString () const override
Public Member Functions inherited from duckdb::CreateInfo
 CreateInfo (CatalogType type, string schema=DEFAULT_SCHEMA, string catalog_p=INVALID_CATALOG)
DUCKDB_API void CopyProperties (CreateInfo &other) const
virtual DUCKDB_API unique_ptr< AlterInfo > GetAlterInfo () const
 Generates an alter statement from the create statement - used for OnCreateConflict::ALTER_ON_CONFLICT.
DUCKDB_API string GetCreatePrefix (const string &entry) const
 Returns a string like "CREATE (OR REPLACE) (TEMPORARY) <entry> (IF NOT EXISTS) " for TABLE/VIEW/TYPE/MACRO.
Public Member Functions inherited from duckdb::ParseInfo
 ParseInfo (ParseInfoType info_type)
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static DUCKDB_API unique_ptr< CreateInfo > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::CreateInfo
static unique_ptr< CreateInfo > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::ParseInfo
static unique_ptr< ParseInfo > Deserialize (Deserializer &deserializer)
static string QualifierToString (const string &catalog, const string &schema, const string &name)
static string TypeToString (CatalogType type)

Public Attributes

string table
 Table name to insert to.
ColumnList columns
 List of columns of the table.
vector< unique_ptr< Constraint > > constraints
 List of constraints on the table.
unique_ptr< SelectStatement > query
 CREATE TABLE as QUERY.
vector< unique_ptr< ParsedExpression > > partition_keys
 Table Partition definitions.
vector< unique_ptr< ParsedExpression > > sort_keys
 Table Sort definitions.
case_insensitive_map_t< unique_ptr< ParsedExpression > > options
 Extra Table options if any.
Public Attributes inherited from duckdb::CreateInfo
CatalogType type
 The to-be-created catalog type.
string catalog
 The catalog name of the entry.
string schema
 The schema name of the entry.
OnCreateConflict on_conflict
 What to do on create conflict.
bool temporary
 Whether or not the entry is temporary.
bool internal
 Whether or not the entry is an internal entry.
string sql
 The SQL string of the CREATE statement.
LogicalDependencyList dependencies
 The inherent dependencies of the created entry.
Value comment
 User provided comment.
InsertionOrderPreservingMap< string > tags
 Key-value tags with additional metadata.
Public Attributes inherited from duckdb::ParseInfo
ParseInfoType info_type

Additional Inherited Members

Static Public Attributes inherited from duckdb::CreateInfo
static constexpr const ParseInfoType TYPE = ParseInfoType::CREATE_INFO

Constructor & Destructor Documentation

◆ CreateTableInfo() [1/3]

duckdb::CreateTableInfo::CreateTableInfo ( )
339725 : CreateInfo(CatalogType::TABLE_ENTRY, INVALID_SCHEMA) {
339726}

◆ CreateTableInfo() [2/3]

duckdb::CreateTableInfo::CreateTableInfo ( string catalog,
string schema,
string name )
339729 : CreateInfo(CatalogType::TABLE_ENTRY, std::move(schema_p), std::move(catalog_p)), table(std::move(name_p)) {
339730}
string table
Table name to insert to.
Definition duckdb.cpp:6862

◆ CreateTableInfo() [3/3]

duckdb::CreateTableInfo::CreateTableInfo ( SchemaCatalogEntry & schema,
string name )
339733 : CreateTableInfo(schema.catalog.GetName(), schema.name, std::move(name_p)) {
339734}
string schema
The schema name of the entry.
Definition duckdb.hpp:28162

Member Function Documentation

◆ Copy()

unique_ptr< CreateInfo > duckdb::CreateTableInfo::Copy ( ) const
overridevirtual

Implements duckdb::CreateInfo.

339736 {
339737 auto result = make_uniq<CreateTableInfo>(catalog, schema, table);
339738 CopyProperties(*result);
339739 result->columns = columns.Copy();
339740 for (auto &constraint : constraints) {
339741 result->constraints.push_back(constraint->Copy());
339742 }
339743 for (auto &partition : partition_keys) {
339744 result->partition_keys.push_back(partition->Copy());
339745 }
339746 for (auto &order : sort_keys) {
339747 result->sort_keys.push_back(order->Copy());
339748 }
339749 for (auto &option : options) {
339750 result->options.emplace(option.first, option.second->Copy());
339751 }
339752 if (query) {
339753 result->query = unique_ptr_cast<SQLStatement, SelectStatement>(query->Copy());
339754 }
339755 return std::move(result);
339756}
int partition(const std::vector< _Tp > &_vec, std::vector< int > &labels, _EqPredicate predicate=_EqPredicate())
string catalog
The catalog name of the entry.
Definition duckdb.hpp:28160
vector< unique_ptr< ParsedExpression > > sort_keys
Table Sort definitions.
Definition duckdb.cpp:6872
case_insensitive_map_t< unique_ptr< ParsedExpression > > options
Extra Table options if any.
Definition duckdb.cpp:6874
vector< unique_ptr< Constraint > > constraints
List of constraints on the table.
Definition duckdb.cpp:6866
ColumnList columns
List of columns of the table.
Definition duckdb.cpp:6864
unique_ptr< SelectStatement > query
CREATE TABLE as QUERY.
Definition duckdb.cpp:6868
vector< unique_ptr< ParsedExpression > > partition_keys
Table Partition definitions.
Definition duckdb.cpp:6870

◆ Serialize()

void duckdb::CreateTableInfo::Serialize ( Serializer & serializer) const
overridevirtual

Reimplemented from duckdb::CreateInfo.

415797 {
415798 CreateInfo::Serialize(serializer);
415799 serializer.WritePropertyWithDefault<string>(200, "table", table);
415800 serializer.WriteProperty<ColumnList>(201, "columns", columns);
415801 serializer.WritePropertyWithDefault<vector<unique_ptr<Constraint>>>(202, "constraints", constraints);
415802 serializer.WritePropertyWithDefault<unique_ptr<SelectStatement>>(203, "query", query);
415803 serializer.WritePropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(204, "partition_keys", partition_keys);
415804 serializer.WritePropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(205, "sort_keys", sort_keys);
415805 serializer.WritePropertyWithDefault<case_insensitive_map_t<unique_ptr<ParsedExpression>>>(206, "options", options);
415806}

◆ Deserialize()

unique_ptr< CreateInfo > duckdb::CreateTableInfo::Deserialize ( Deserializer & deserializer)
static
415808 {
415809 auto result = duckdb::unique_ptr<CreateTableInfo>(new CreateTableInfo());
415810 deserializer.ReadPropertyWithDefault<string>(200, "table", result->table);
415811 deserializer.ReadProperty<ColumnList>(201, "columns", result->columns);
415812 deserializer.ReadPropertyWithDefault<vector<unique_ptr<Constraint>>>(202, "constraints", result->constraints);
415813 deserializer.ReadPropertyWithDefault<unique_ptr<SelectStatement>>(203, "query", result->query);
415814 deserializer.ReadPropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(204, "partition_keys", result->partition_keys);
415815 deserializer.ReadPropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(205, "sort_keys", result->sort_keys);
415816 deserializer.ReadPropertyWithDefault<case_insensitive_map_t<unique_ptr<ParsedExpression>>>(206, "options", result->options);
415817 return std::move(result);
415818}

◆ ExtraOptionsToString()

string duckdb::CreateTableInfo::ExtraOptionsToString ( ) const
339758 {
339759 string ret;
339760 if (!partition_keys.empty()) {
339761 ret += " PARTITIONED BY (";
339762 for (auto &partition : partition_keys) {
339763 ret += partition->ToString() + ",";
339764 }
339765 ret.pop_back();
339766 ret += ")";
339767 }
339768 if (!sort_keys.empty()) {
339769 ret += " SORTED BY (";
339770 for (auto &order : sort_keys) {
339771 ret += order->ToString() + ",";
339772 }
339773 ret.pop_back();
339774 ret += ")";
339775 }
339776 if (!options.empty()) {
339777 ret += " WITH (";
339778 for (auto &entry : options) {
339779 ret += "'" + entry.first + "'=" + entry.second->ToString() + ",";
339780 }
339781 ret.pop_back();
339782 ret += ")";
339783 }
339784 return ret;
339785}

◆ ToString()

string duckdb::CreateTableInfo::ToString ( ) const
overridevirtual

Reimplemented from duckdb::CreateInfo.

339787 {
339788 string ret = GetCreatePrefix("TABLE");
339789 ret += QualifierToString(temporary ? "" : catalog, schema, table);
339790
339791 if (query != nullptr) {
339793 ret += ExtraOptionsToString();
339794 ret += " AS " + query->ToString();
339795 } else {
339796 ret += TableCatalogEntry::ColumnsToSQL(columns, constraints);
339797 ret += ExtraOptionsToString();
339798 ret += ";";
339799 }
339800 return ret;
339801}
static string ColumnNamesToSQL(const ColumnList &columns)
Returns the expression string list of the column names e.g. (col1, col2, col3).
Definition duckdb.cpp:21093
bool temporary
Whether or not the entry is temporary.
Definition duckdb.hpp:28166
DUCKDB_API string GetCreatePrefix(const string &entry) const
Returns a string like "CREATE (OR REPLACE) (TEMPORARY) <entry> (IF NOT EXISTS) " for TABLE/VIEW/TYPE/...
Definition duckdb.cpp:339436

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