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

Function bindFunc

src/function/table/show_attached_databases.cpp:39–52  ·  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;
42 std::vector<LogicalType> columnTypes;
43 columnNames.emplace_back("name");
44 columnTypes.emplace_back(LogicalType::STRING());
45 columnNames.emplace_back("database type");
46 columnTypes.emplace_back(LogicalType::STRING());
47 auto attachedDatabases = main::DatabaseManager::Get(*context)->getAttachedDatabases();
48 columnNames = TableFunction::extractYieldVariables(columnNames, input->yieldVariables);
49 auto columns = input->binder->createVariables(columnNames, columnTypes);
50 return std::make_unique<ShowAttachedDatabasesBindData>(attachedDatabases, columns,
51 attachedDatabases.size());
52}
53
54function_set ShowAttachedDatabasesFunction::getFunctionSet() {
55 function_set functionSet;

Callers

nothing calls this directly

Calls 4

emplace_backMethod · 0.80
getAttachedDatabasesMethod · 0.80
createVariablesMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected