//===----------------------------------------------------------------------===// // DuckDB // // duckdb/parser/statement/select_statement.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/common/unordered_map.hpp" #include "duckdb/parser/parsed_expression.hpp" #include "duckdb/parser/sql_statement.hpp" #include "duckdb/parser/tableref.hpp" #include "duckdb/parser/query_node.hpp" namespace duckdb { class QueryNode; class FormatSerializer; class FormatDeserializer; //! SelectStatement is a typical SELECT clause class SelectStatement : public SQLStatement { public: static constexpr const StatementType TYPE = StatementType::SELECT_STATEMENT; public: SelectStatement() : SQLStatement(StatementType::SELECT_STATEMENT) { } //! The main query node unique_ptr node; protected: SelectStatement(const SelectStatement &other); public: //! Convert the SELECT statement to a string DUCKDB_API string ToString() const override; //! Create a copy of this SelectStatement DUCKDB_API unique_ptr Copy() const override; //! Serializes a SelectStatement to a stand-alone binary blob void Serialize(Serializer &serializer) const; //! Deserializes a blob back into a SelectStatement, returns nullptr if //! deserialization is not possible static unique_ptr Deserialize(Deserializer &source); //! Whether or not the statements are equivalent bool Equals(const SQLStatement &other) const; void FormatSerialize(FormatSerializer &serializer) const; static unique_ptr FormatDeserialize(FormatDeserializer &deserializer); }; } // namespace duckdb