//===----------------------------------------------------------------------===// // DuckDB // // duckdb/parser/expression/between_expression.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/parser/parsed_expression.hpp" namespace duckdb { class BetweenExpression : public ParsedExpression { public: static constexpr const ExpressionClass TYPE = ExpressionClass::BETWEEN; public: DUCKDB_API BetweenExpression(unique_ptr input, unique_ptr lower, unique_ptr upper); unique_ptr input; unique_ptr lower; unique_ptr upper; public: string ToString() const override; static bool Equal(const BetweenExpression &a, const BetweenExpression &b); unique_ptr Copy() const override; void Serialize(FieldWriter &writer) const override; static unique_ptr Deserialize(ExpressionType type, FieldReader &source); void FormatSerialize(FormatSerializer &serializer) const override; static unique_ptr FormatDeserialize(ExpressionType type, FormatDeserializer &deserializer); public: template static string ToString(const T &entry) { return "(" + entry.input->ToString() + " BETWEEN " + entry.lower->ToString() + " AND " + entry.upper->ToString() + ")"; } }; } // namespace duckdb