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

Function getObjectScanFunc

src/binder/bind/bind_file_scan.cpp:188–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188static TableFunction getObjectScanFunc(const std::string& dbName, const std::string& tableName,
189 main::ClientContext* clientContext) {
190 // Bind external database table
191 auto attachedDB = main::DatabaseManager::Get(*clientContext)->getAttachedDatabase(dbName);
192
193 if (attachedDB == nullptr) {
194 throw BinderException(std::format("No attached database named {}.", dbName));
195 }
196
197 auto attachedCatalog = attachedDB->getCatalog();
198 auto entry = attachedCatalog->getTableCatalogEntry(
199 transaction::Transaction::Get(*clientContext), tableName);
200 auto scanFunc = entry->ptrCast<TableCatalogEntry>()->getScanFunction();
201 DASSERT(scanFunc.has_value());
202 return *scanFunc;
203}
204
205BoundTableScanInfo bindTableScanSourceInfo(Binder& binder, TableFunction func,
206 const std::string& sourceName, std::unique_ptr<TableFuncBindData> bindData,

Callers 1

bindObjectScanSourceMethod · 0.85

Calls 4

getCatalogMethod · 0.80
getTableCatalogEntryMethod · 0.80
getAttachedDatabaseMethod · 0.45
getScanFunctionMethod · 0.45

Tested by

no test coverage detected