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::BuiltinFunctions Class Reference
Collaboration diagram for duckdb::BuiltinFunctions:

Public Member Functions

 BuiltinFunctions (CatalogTransaction transaction, Catalog &catalog)
void Initialize ()
 Initialize a catalog with all built-in functions.
void AddFunction (AggregateFunctionSet set)
void AddFunction (AggregateFunction function)
void AddFunction (ScalarFunctionSet set)
void AddFunction (PragmaFunction function)
void AddFunction (const string &name, PragmaFunctionSet functions)
void AddFunction (ScalarFunction function)
void AddFunction (const vector< string > &names, ScalarFunction function)
void AddFunction (TableFunctionSet set)
void AddFunction (TableFunction function)
void AddFunction (CopyFunction function)
void AddCollation (string name, ScalarFunction function, bool combinable=false, bool not_required_for_equality=false)

Private Member Functions

template<class T>
void Register ()
void RegisterTableScanFunctions ()
void RegisterSQLiteFunctions ()
void RegisterReadFunctions ()
void RegisterTableFunctions ()
void RegisterArrowFunctions ()
void RegisterSnifferFunction ()
void RegisterCopyFunctions ()
void RegisterExtensionOverloads ()
void RegisterPragmaFunctions ()
void AddExtensionFunction (ScalarFunctionSet set)

Private Attributes

CatalogTransaction transaction
Catalog & catalog

Constructor & Destructor Documentation

◆ BuiltinFunctions()

duckdb::BuiltinFunctions::BuiltinFunctions ( CatalogTransaction transaction,
Catalog & catalog )
211694 : transaction(transaction), catalog(catalog) {
211695}

◆ ~BuiltinFunctions()

duckdb::BuiltinFunctions::~BuiltinFunctions ( )
211697 {
211698}

Member Function Documentation

◆ Initialize()

void duckdb::BuiltinFunctions::Initialize ( )

Initialize a catalog with all built-in functions.

220867 {
220868 RegisterTableScanFunctions();
220869 RegisterSQLiteFunctions();
220870 RegisterReadFunctions();
220871 RegisterTableFunctions();
220872 RegisterArrowFunctions();
220873
220874 RegisterPragmaFunctions();
220875
220876 RegisterCopyFunctions();
220877
220878 // initialize collations
220879 AddCollation("nocase", LowerFun::GetFunction(), true);
220880 AddCollation("noaccent", StripAccentsFun::GetFunction(), true);
220881 AddCollation("nfc", NFCNormalizeFun::GetFunction());
220882
220883 RegisterExtensionOverloads();
220884}

◆ AddFunction() [1/10]

void duckdb::BuiltinFunctions::AddFunction ( AggregateFunctionSet set)
211707 {
211708 CreateAggregateFunctionInfo info(std::move(set));
211709 info.internal = true;
211710 catalog.CreateFunction(transaction, info);
211711}

◆ AddFunction() [2/10]

void duckdb::BuiltinFunctions::AddFunction ( AggregateFunction function)
211713 {
211714 CreateAggregateFunctionInfo info(std::move(function));
211715 info.internal = true;
211716 catalog.CreateFunction(transaction, info);
211717}

◆ AddFunction() [3/10]

void duckdb::BuiltinFunctions::AddFunction ( ScalarFunctionSet set)
211744 {
211745 CreateScalarFunctionInfo info(std::move(set));
211746 info.internal = true;
211747 catalog.CreateFunction(transaction, info);
211748}

◆ AddFunction() [4/10]

void duckdb::BuiltinFunctions::AddFunction ( PragmaFunction function)
211719 {
211720 CreatePragmaFunctionInfo info(std::move(function));
211721 info.internal = true;
211722 catalog.CreatePragmaFunction(transaction, info);
211723}

◆ AddFunction() [5/10]

void duckdb::BuiltinFunctions::AddFunction ( const string & name,
PragmaFunctionSet functions )
211725 {
211726 CreatePragmaFunctionInfo info(name, std::move(functions));
211727 info.internal = true;
211728 catalog.CreatePragmaFunction(transaction, info);
211729}

◆ AddFunction() [6/10]

void duckdb::BuiltinFunctions::AddFunction ( ScalarFunction function)
211731 {
211732 CreateScalarFunctionInfo info(std::move(function));
211733 info.internal = true;
211734 catalog.CreateFunction(transaction, info);
211735}

◆ AddFunction() [7/10]

void duckdb::BuiltinFunctions::AddFunction ( const vector< string > & names,
ScalarFunction function )
211737 { // NOLINT: false positive
211738 for (auto &name : names) {
211739 function.name = name;
211740 AddFunction(function);
211741 }
211742}

◆ AddFunction() [8/10]

void duckdb::BuiltinFunctions::AddFunction ( TableFunctionSet set)
211756 {
211757 CreateTableFunctionInfo info(std::move(set));
211758 info.internal = true;
211759 catalog.CreateTableFunction(transaction, info);
211760}

◆ AddFunction() [9/10]

void duckdb::BuiltinFunctions::AddFunction ( TableFunction function)
211750 {
211751 CreateTableFunctionInfo info(std::move(function));
211752 info.internal = true;
211753 catalog.CreateTableFunction(transaction, info);
211754}

◆ AddFunction() [10/10]

void duckdb::BuiltinFunctions::AddFunction ( CopyFunction function)
211762 {
211763 CreateCopyFunctionInfo info(std::move(function));
211764 info.internal = true;
211765 catalog.CreateCopyFunction(transaction, info);
211766}

◆ AddCollation()

void duckdb::BuiltinFunctions::AddCollation ( string name,
ScalarFunction function,
bool combinable = false,
bool not_required_for_equality = false )
211701 {
211702 CreateCollationInfo info(std::move(name), std::move(function), combinable, not_required_for_equality);
211703 info.internal = true;
211704 catalog.CreateCollation(transaction, info);
211705}

◆ Register()

template<class T>
void duckdb::BuiltinFunctions::Register ( )
inlineprivate
7086 {
7087 T::RegisterFunction(*this);
7088 }

◆ RegisterTableScanFunctions()

void duckdb::BuiltinFunctions::RegisterTableScanFunctions ( )
private
252035 {
252036 TableScanFunction::RegisterFunction(*this);
252037}

◆ RegisterSQLiteFunctions()

void duckdb::BuiltinFunctions::RegisterSQLiteFunctions ( )
private
251076 {
251077 PragmaVersion::RegisterFunction(*this);
251078 PragmaPlatform::RegisterFunction(*this);
251079 PragmaCollations::RegisterFunction(*this);
251080 PragmaTableInfo::RegisterFunction(*this);
251081 PragmaStorageInfo::RegisterFunction(*this);
251082 PragmaMetadataInfo::RegisterFunction(*this);
251083 PragmaDatabaseSize::RegisterFunction(*this);
251084 PragmaUserAgent::RegisterFunction(*this);
251085
251086 DuckDBConnectionCountFun::RegisterFunction(*this);
251087 DuckDBApproxDatabaseCountFun::RegisterFunction(*this);
251088 DuckDBColumnsFun::RegisterFunction(*this);
251089 DuckDBConstraintsFun::RegisterFunction(*this);
251090 DuckDBCoordinateSystemsFun::RegisterFunction(*this);
251091 DuckDBDatabasesFun::RegisterFunction(*this);
251092 DuckDBFunctionsFun::RegisterFunction(*this);
251093 DuckDBKeywordsFun::RegisterFunction(*this);
251094 DuckDBPreparedStatementsFun::RegisterFunction(*this);
251095 DuckDBLogFun::RegisterFunction(*this);
251096 DuckDBLogContextFun::RegisterFunction(*this);
251097 DuckDBIndexesFun::RegisterFunction(*this);
251098 DuckDBSchemasFun::RegisterFunction(*this);
251099 DuckDBDependenciesFun::RegisterFunction(*this);
251100 DuckDBExtensionsFun::RegisterFunction(*this);
251101 DuckDBMemoryFun::RegisterFunction(*this);
251102 DuckDBExternalFileCacheFun::RegisterFunction(*this);
251103 DuckDBOptimizersFun::RegisterFunction(*this);
251104 DuckDBSecretsFun::RegisterFunction(*this);
251105 DuckDBWhichSecretFun::RegisterFunction(*this);
251106 DuckDBSecretTypesFun::RegisterFunction(*this);
251107 DuckDBSequencesFun::RegisterFunction(*this);
251108 DuckDBSettingsFun::RegisterFunction(*this);
251109 DuckDBTablesFun::RegisterFunction(*this);
251110 DuckDBTableSample::RegisterFunction(*this);
251111 DuckDBTemporaryFilesFun::RegisterFunction(*this);
251112 DuckDBTypesFun::RegisterFunction(*this);
251113 DuckDBVariablesFun::RegisterFunction(*this);
251114 DuckDBViewsFun::RegisterFunction(*this);
251115 EnableLoggingFun::RegisterFunction(*this);
251116 EnableProfilingFun::RegisterFunction(*this);
251117 TestAllTypesFun::RegisterFunction(*this);
251118 TestVectorTypesFun::RegisterFunction(*this);
251119}

◆ RegisterReadFunctions()

void duckdb::BuiltinFunctions::RegisterReadFunctions ( )
private
243291 {
243292 CSVCopyFunction::RegisterFunction(*this);
243293 ReadCSVTableFunction::RegisterFunction(*this);
243294 AddFunction(MultiFileReader::CreateFunctionSet(ReadDuckDBTableFunction::GetFunction()));
243295 auto &config = DBConfig::GetConfig(*transaction.db);
243296 config.replacement_scans.emplace_back(ReadCSVReplacement);
243297 config.replacement_scans.emplace_back(ReadDuckDBTableFunction::ReplacementScan);
243298}
static DUCKDB_API TableFunctionSet CreateFunctionSet(TableFunction table_function)
Creates a table function set from a single reader function (including e.g. list parameters,...
Definition duckdb.cpp:84731

◆ RegisterTableFunctions()

void duckdb::BuiltinFunctions::RegisterTableFunctions ( )
private
243061 {
243062 CheckpointFunction::RegisterFunction(*this);
243063 GlobTableFunction::RegisterFunction(*this);
243064 RangeTableFunction::RegisterFunction(*this);
243065 RepeatTableFunction::RegisterFunction(*this);
243066 SummaryTableFunction::RegisterFunction(*this);
243067 UnnestTableFunction::RegisterFunction(*this);
243068 RepeatRowTableFunction::RegisterFunction(*this);
243069 CSVSnifferFunction::RegisterFunction(*this);
243070 ReadBlobFunction::RegisterFunction(*this);
243071 ReadTextFunction::RegisterFunction(*this);
243072 QueryTableFunction::RegisterFunction(*this);
243073}

◆ RegisterArrowFunctions()

void duckdb::BuiltinFunctions::RegisterArrowFunctions ( )
private
239994 {
239995 ArrowTableFunction::RegisterFunction(*this);
239996}

◆ RegisterCopyFunctions()

void duckdb::BuiltinFunctions::RegisterCopyFunctions ( )
private
220565 {
220566 CopyFunction info("blob");
220567 info.copy_to_bind = WriteBlobBind;
220568 info.copy_to_initialize_local = WriteBlobInitializeLocal;
220569 info.copy_to_initialize_global = WriteBlobInitializeGlobal;
220570 info.copy_to_sink = WriteBlobSink;
220571 info.copy_to_combine = WriteBlobCombine;
220572 info.copy_to_finalize = WriteBlobFinalize;
220573 info.extension = "blob";
220574
220575 AddFunction(info);
220576}

◆ RegisterExtensionOverloads()

void duckdb::BuiltinFunctions::RegisterExtensionOverloads ( )
private
211811 {
211812#ifdef GENERATE_EXTENSION_ENTRIES
211813 // do not insert auto loading placeholders when generating extension entries
211814 return;
211815#endif
211816 ScalarFunctionSet current_set;
211817 for (auto &entry : EXTENSION_FUNCTION_OVERLOADS) {
211818 vector<LogicalType> arguments;
211819 auto splits = StringUtil::Split(entry.signature, ">");
211820 auto return_type = DBConfig::ParseLogicalType(splits[1]);
211821 auto parameters = Value(splits[0]).DefaultCastAs(LogicalType::LIST(LogicalType::VARCHAR));
211822 for (auto &param : ListValue::GetChildren(parameters)) {
211823 arguments.push_back(DBConfig::ParseLogicalType(param.GetValue<string>()));
211824 }
211825 if (entry.type != CatalogType::SCALAR_FUNCTION_ENTRY) {
211826 throw InternalException(
211827 "Extension function overloads only supported for scalar functions currently - %s has a different type",
211828 entry.name);
211829 }
211830
211831 ScalarFunction function(entry.name, std::move(arguments), std::move(return_type), nullptr,
211832 BindExtensionFunction);
211833 function.SetExtraFunctionInfo<ExtensionFunctionInfo>(entry.extension);
211834 if (current_set.name != entry.name) {
211835 if (!current_set.name.empty()) {
211836 // create set of functions
211837 AddExtensionFunction(current_set);
211838 }
211839 current_set = ScalarFunctionSet(entry.name);
211840 }
211841 // add this function to the set of function overloads
211842 current_set.AddFunction(std::move(function));
211843 }
211844 AddExtensionFunction(std::move(current_set));
211845}
static DUCKDB_API vector< string > Split(const string &str, char delimiter)
Split the input string based on newline char.
Definition duckdb.cpp:109734

◆ RegisterPragmaFunctions()

void duckdb::BuiltinFunctions::RegisterPragmaFunctions ( )
private
229977 {
229978 Register<PragmaQueries>();
229979 Register<PragmaFunctions>();
229980}

◆ AddExtensionFunction()

void duckdb::BuiltinFunctions::AddExtensionFunction ( ScalarFunctionSet set)
private
211805 {
211806 CreateScalarFunctionInfo info(std::move(set));
211807 info.internal = true;
211808 catalog.CreateFunction(transaction, info);
211809}

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