//===----------------------------------------------------------------------===// // DuckDB // // duckdb/planner/expression/bound_between_expression.hpp // // //===----------------------------------------------------------------------===// #pragma once #include "duckdb/planner/expression.hpp" namespace duckdb { class BoundBetweenExpression : public Expression { public: static constexpr const ExpressionClass TYPE = ExpressionClass::BOUND_BETWEEN; public: BoundBetweenExpression(unique_ptr input, unique_ptr lower, unique_ptr upper, bool lower_inclusive, bool upper_inclusive); unique_ptr input; unique_ptr lower; unique_ptr upper; bool lower_inclusive; bool upper_inclusive; public: string ToString() const override; bool Equals(const BaseExpression &other) const override; unique_ptr Copy() override; void Serialize(FieldWriter &writer) const override; static unique_ptr Deserialize(ExpressionDeserializationState &state, FieldReader &reader); public: ExpressionType LowerComparisonType() { return lower_inclusive ? ExpressionType::COMPARE_GREATERTHANOREQUALTO : ExpressionType::COMPARE_GREATERTHAN; } ExpressionType UpperComparisonType() { return upper_inclusive ? ExpressionType::COMPARE_LESSTHANOREQUALTO : ExpressionType::COMPARE_LESSTHAN; } }; } // namespace duckdb