| 186 | } |
| 187 | |
| 188 | static 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 | |
| 205 | BoundTableScanInfo bindTableScanSourceInfo(Binder& binder, TableFunction func, |
| 206 | const std::string& sourceName, std::unique_ptr<TableFuncBindData> bindData, |
no test coverage detected