//===----------------------------------------------------------------------===// // DuckDB // // duckdb/catalog/catalog_entry/view_catalog_entry.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/catalog/standard_entry.hpp" #include "duckdb/parser/statement/select_statement.hpp" #include "duckdb/common/types.hpp" #include "duckdb/common/vector.hpp" namespace duckdb { class DataTable; struct CreateViewInfo; //! A view catalog entry class ViewCatalogEntry : public StandardEntry { public: static constexpr const CatalogType Type = CatalogType::VIEW_ENTRY; static constexpr const char *Name = "view"; public: //! Create a real TableCatalogEntry and initialize storage for it ViewCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateViewInfo &info); //! The query of the view unique_ptr query; //! The SQL query (if any) string sql; //! The set of aliases associated with the view vector aliases; //! The returned types of the view vector types; public: unique_ptr AlterEntry(ClientContext &context, AlterInfo &info) override; //! Serialize the meta information of the ViewCatalogEntry a serializer virtual void Serialize(Serializer &serializer) const; //! Deserializes to a CreateTableInfo static unique_ptr Deserialize(Deserializer &source, ClientContext &context); unique_ptr Copy(ClientContext &context) const override; string ToSQL() const override; private: void Initialize(CreateViewInfo &info); }; } // namespace duckdb