1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/parser/expression/collate_expression.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/parser/parsed_expression.hpp"
12
13namespace duckdb {
14
15//! CollateExpression represents a COLLATE statement
16class CollateExpression : public ParsedExpression {
17public:
18 static constexpr const ExpressionClass TYPE = ExpressionClass::COLLATE;
19
20public:
21 CollateExpression(string collation, unique_ptr<ParsedExpression> child);
22
23 //! The child of the cast expression
24 unique_ptr<ParsedExpression> child;
25 //! The collation clause
26 string collation;
27
28public:
29 string ToString() const override;
30
31 static bool Equal(const CollateExpression &a, const CollateExpression &b);
32
33 unique_ptr<ParsedExpression> Copy() const override;
34
35 void Serialize(FieldWriter &writer) const override;
36 static unique_ptr<ParsedExpression> Deserialize(ExpressionType type, FieldReader &source);
37 void FormatSerialize(FormatSerializer &serializer) const override;
38 static unique_ptr<ParsedExpression> FormatDeserialize(ExpressionType type, FormatDeserializer &deserializer);
39};
40} // namespace duckdb
41