1 | #include "duckdb/catalog/catalog_entry.hpp" |
2 | |
3 | #include "duckdb/catalog/catalog.hpp" |
4 | |
5 | namespace duckdb { |
6 | |
7 | CatalogEntry::CatalogEntry(CatalogType type, string name_p, idx_t oid) |
8 | : oid(oid), type(type), set(nullptr), name(std::move(name_p)), deleted(false), temporary(false), internal(false), |
9 | parent(nullptr) { |
10 | } |
11 | |
12 | CatalogEntry::CatalogEntry(CatalogType type, Catalog &catalog, string name_p) |
13 | : CatalogEntry(type, std::move(name_p), catalog.ModifyCatalog()) { |
14 | } |
15 | |
16 | CatalogEntry::~CatalogEntry() { |
17 | } |
18 | |
19 | void CatalogEntry::SetAsRoot() { |
20 | } |
21 | |
22 | // LCOV_EXCL_START |
23 | unique_ptr<CatalogEntry> CatalogEntry::AlterEntry(ClientContext &context, AlterInfo &info) { |
24 | throw InternalException("Unsupported alter type for catalog entry!" ); |
25 | } |
26 | |
27 | void CatalogEntry::UndoAlter(ClientContext &context, AlterInfo &info) { |
28 | } |
29 | |
30 | unique_ptr<CatalogEntry> CatalogEntry::Copy(ClientContext &context) const { |
31 | throw InternalException("Unsupported copy type for catalog entry!" ); |
32 | } |
33 | |
34 | string CatalogEntry::ToSQL() const { |
35 | throw InternalException("Unsupported catalog type for ToSQL()" ); |
36 | } |
37 | |
38 | Catalog &CatalogEntry::ParentCatalog() { |
39 | throw InternalException("CatalogEntry::ParentCatalog called on catalog entry without catalog" ); |
40 | } |
41 | |
42 | SchemaCatalogEntry &CatalogEntry::ParentSchema() { |
43 | throw InternalException("CatalogEntry::ParentSchema called on catalog entry without schema" ); |
44 | } |
45 | // LCOV_EXCL_STOP |
46 | |
47 | void CatalogEntry::Verify(Catalog &catalog_p) { |
48 | } |
49 | |
50 | InCatalogEntry::InCatalogEntry(CatalogType type, Catalog &catalog, string name) |
51 | : CatalogEntry(type, catalog, std::move(name)), catalog(catalog) { |
52 | } |
53 | |
54 | InCatalogEntry::~InCatalogEntry() { |
55 | } |
56 | |
57 | void InCatalogEntry::Verify(Catalog &catalog_p) { |
58 | D_ASSERT(&catalog_p == &catalog); |
59 | } |
60 | } // namespace duckdb |
61 | |