2021-06-14 04:13:35 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Common/FieldVisitors.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/** Prints Field as literal in SQL query */
|
|
|
|
class FieldVisitorToString : public StaticVisitor<String>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
String operator() (const Null & x) const;
|
|
|
|
String operator() (const UInt64 & x) const;
|
|
|
|
String operator() (const UInt128 & x) const;
|
|
|
|
String operator() (const UInt256 & x) const;
|
|
|
|
String operator() (const Int64 & x) const;
|
|
|
|
String operator() (const Int128 & x) const;
|
|
|
|
String operator() (const Int256 & x) const;
|
|
|
|
String operator() (const UUID & x) const;
|
|
|
|
String operator() (const Float64 & x) const;
|
|
|
|
String operator() (const String & x) const;
|
|
|
|
String operator() (const Array & x) const;
|
|
|
|
String operator() (const Tuple & x) const;
|
|
|
|
String operator() (const Map & x) const;
|
2021-08-20 21:11:22 +00:00
|
|
|
String operator() (const Object & x) const;
|
2021-06-14 04:13:35 +00:00
|
|
|
String operator() (const DecimalField<Decimal32> & x) const;
|
|
|
|
String operator() (const DecimalField<Decimal64> & x) const;
|
|
|
|
String operator() (const DecimalField<Decimal128> & x) const;
|
|
|
|
String operator() (const DecimalField<Decimal256> & x) const;
|
|
|
|
String operator() (const AggregateFunctionStateData & x) const;
|
2022-01-18 11:52:27 +00:00
|
|
|
String operator() (const bool & x) const;
|
2021-06-14 04:13:35 +00:00
|
|
|
};
|
|
|
|
|
2022-09-05 16:55:00 +00:00
|
|
|
/// Get value from field and convert it to string.
|
|
|
|
/// Also remove quotes from strings.
|
|
|
|
String convertFieldToString(const Field & field);
|
2021-06-14 04:13:35 +00:00
|
|
|
|
2022-09-05 16:55:00 +00:00
|
|
|
}
|