MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / bindFunc

Function bindFunc

src/function/table/show_warnings.cpp:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39static std::unique_ptr<TableFuncBindData> bindFunc(const main::ClientContext* context,
40 const TableFuncBindInput* input) {
41 std::vector<std::string> columnNames{WarningConstants::WARNING_TABLE_COLUMN_NAMES.begin(),
42 WarningConstants::WARNING_TABLE_COLUMN_NAMES.end()};
43 std::vector<LogicalType> columnTypes{WarningConstants::WARNING_TABLE_COLUMN_DATA_TYPES.begin(),
44 WarningConstants::WARNING_TABLE_COLUMN_DATA_TYPES.end()};
45 std::vector<processor::WarningInfo> warningInfos;
46 for (const auto& warning : processor::WarningContext::Get(*context)->getPopulatedWarnings()) {
47 warningInfos.emplace_back(warning);
48 }
49 columnNames = TableFunction::extractYieldVariables(columnNames, input->yieldVariables);
50 auto columns = input->binder->createVariables(columnNames, columnTypes);
51 return std::make_unique<ShowWarningsBindData>(std::move(warningInfos), columns,
52 warningInfos.size());
53}
54
55function_set ShowWarningsFunction::getFunctionSet() {
56 function_set functionSet;

Callers

nothing calls this directly

Calls 5

emplace_backMethod · 0.80
createVariablesMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected