//===----------------------------------------------------------------------===// // DuckDB // // duckdb/parser/parsed_data/create_view_info.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/parser/parsed_data/create_info.hpp" #include "duckdb/parser/statement/select_statement.hpp" namespace duckdb { class SchemaCatalogEntry; struct CreateViewInfo : public CreateInfo { CreateViewInfo(); CreateViewInfo(SchemaCatalogEntry &schema, string view_name); CreateViewInfo(string catalog_p, string schema_p, string view_name); //! Table name to insert to string view_name; //! Aliases of the view vector aliases; //! Return types vector types; //! The SelectStatement of the view unique_ptr query; public: unique_ptr Copy() const override; static unique_ptr Deserialize(Deserializer &deserializer); //! Gets a bound CreateViewInfo object from a SELECT statement and a view name, schema name, etc DUCKDB_API static unique_ptr FromSelect(ClientContext &context, unique_ptr info); //! Gets a bound CreateViewInfo object from a CREATE VIEW statement DUCKDB_API static unique_ptr FromCreateView(ClientContext &context, const string &sql); protected: void SerializeInternal(Serializer &serializer) const override; }; } // namespace duckdb