|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// DuckDB |
| 3 | +// |
| 4 | +// storage/postgres_schema_entry.hpp |
| 5 | +// |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | + |
| 9 | +#pragma once |
| 10 | + |
| 11 | +#include "duckdb/catalog/catalog_entry/schema_catalog_entry.hpp" |
| 12 | + |
| 13 | +namespace duckdb { |
| 14 | +class PostgresTransaction; |
| 15 | + |
| 16 | +class PostgresSchemaEntry : public SchemaCatalogEntry { |
| 17 | +public: |
| 18 | + PostgresSchemaEntry(Catalog &catalog); |
| 19 | + |
| 20 | +public: |
| 21 | + optional_ptr<CatalogEntry> CreateTable(CatalogTransaction transaction, BoundCreateTableInfo &info) override; |
| 22 | + optional_ptr<CatalogEntry> CreateFunction(CatalogTransaction transaction, CreateFunctionInfo &info) override; |
| 23 | + optional_ptr<CatalogEntry> CreateIndex(ClientContext &context, CreateIndexInfo &info, |
| 24 | + TableCatalogEntry &table) override; |
| 25 | + optional_ptr<CatalogEntry> CreateView(CatalogTransaction transaction, CreateViewInfo &info) override; |
| 26 | + optional_ptr<CatalogEntry> CreateSequence(CatalogTransaction transaction, CreateSequenceInfo &info) override; |
| 27 | + optional_ptr<CatalogEntry> CreateTableFunction(CatalogTransaction transaction, |
| 28 | + CreateTableFunctionInfo &info) override; |
| 29 | + optional_ptr<CatalogEntry> CreateCopyFunction(CatalogTransaction transaction, |
| 30 | + CreateCopyFunctionInfo &info) override; |
| 31 | + optional_ptr<CatalogEntry> CreatePragmaFunction(CatalogTransaction transaction, |
| 32 | + CreatePragmaFunctionInfo &info) override; |
| 33 | + optional_ptr<CatalogEntry> CreateCollation(CatalogTransaction transaction, CreateCollationInfo &info) override; |
| 34 | + optional_ptr<CatalogEntry> CreateType(CatalogTransaction transaction, CreateTypeInfo &info) override; |
| 35 | + void Alter(ClientContext &context, AlterInfo &info) override; |
| 36 | + void Scan(ClientContext &context, CatalogType type, const std::function<void(CatalogEntry &)> &callback) override; |
| 37 | + void Scan(CatalogType type, const std::function<void(CatalogEntry &)> &callback) override; |
| 38 | + void DropEntry(ClientContext &context, DropInfo &info) override; |
| 39 | + optional_ptr<CatalogEntry> GetEntry(CatalogTransaction transaction, CatalogType type, const string &name) override; |
| 40 | + |
| 41 | +private: |
| 42 | + void AlterTable(PostgresTransaction &transaction, RenameTableInfo &info); |
| 43 | + void AlterTable(PostgresTransaction &transaction, RenameColumnInfo &info); |
| 44 | + void AlterTable(PostgresTransaction &transaction, AddColumnInfo &info); |
| 45 | + void AlterTable(PostgresTransaction &transaction, RemoveColumnInfo &info); |
| 46 | + |
| 47 | + void TryDropEntry(ClientContext &context, CatalogType catalog_type, const string &name); |
| 48 | +}; |
| 49 | + |
| 50 | +} // namespace duckdb |
0 commit comments