1#include "duckdb/catalog/dependency_list.hpp"
2#include "duckdb/catalog/catalog_entry.hpp"
3#include "duckdb/catalog/catalog.hpp"
4
5namespace duckdb {
6
7void DependencyList::AddDependency(CatalogEntry &entry) {
8 if (entry.internal) {
9 return;
10 }
11 set.insert(x: entry);
12}
13
14void DependencyList::VerifyDependencies(Catalog &catalog, const string &name) {
15 for (auto &dep_entry : set) {
16 auto &dep = dep_entry.get();
17 if (&dep.ParentCatalog() != &catalog) {
18 throw DependencyException(
19 "Error adding dependency for object \"%s\" - dependency \"%s\" is in catalog "
20 "\"%s\", which does not match the catalog \"%s\".\nCross catalog dependencies are not supported.",
21 name, dep.name, dep.ParentCatalog().GetName(), catalog.GetName());
22 }
23 }
24}
25
26} // namespace duckdb
27