1#include "duckdb/common/operator/convert_to_string.hpp"
2#include "duckdb/common/operator/string_cast.hpp"
3#include "duckdb/common/types/vector.hpp"
4
5namespace duckdb {
6
7template <class T>
8string StandardStringCast(T input) {
9 Vector v(LogicalType::VARCHAR);
10 return StringCast::Operation(input, v).GetString();
11}
12
13template <>
14string ConvertToString::Operation(bool input) {
15 return StandardStringCast(input);
16}
17template <>
18string ConvertToString::Operation(int8_t input) {
19 return StandardStringCast(input);
20}
21template <>
22string ConvertToString::Operation(int16_t input) {
23 return StandardStringCast(input);
24}
25template <>
26string ConvertToString::Operation(int32_t input) {
27 return StandardStringCast(input);
28}
29template <>
30string ConvertToString::Operation(int64_t input) {
31 return StandardStringCast(input);
32}
33template <>
34string ConvertToString::Operation(uint8_t input) {
35 return StandardStringCast(input);
36}
37template <>
38string ConvertToString::Operation(uint16_t input) {
39 return StandardStringCast(input);
40}
41template <>
42string ConvertToString::Operation(uint32_t input) {
43 return StandardStringCast(input);
44}
45template <>
46string ConvertToString::Operation(uint64_t input) {
47 return StandardStringCast(input);
48}
49template <>
50string ConvertToString::Operation(hugeint_t input) {
51 return StandardStringCast(input);
52}
53template <>
54string ConvertToString::Operation(float input) {
55 return StandardStringCast(input);
56}
57template <>
58string ConvertToString::Operation(double input) {
59 return StandardStringCast(input);
60}
61template <>
62string ConvertToString::Operation(interval_t input) {
63 return StandardStringCast(input);
64}
65template <>
66string ConvertToString::Operation(date_t input) {
67 return StandardStringCast(input);
68}
69template <>
70string ConvertToString::Operation(dtime_t input) {
71 return StandardStringCast(input);
72}
73template <>
74string ConvertToString::Operation(timestamp_t input) {
75 return StandardStringCast(input);
76}
77template <>
78string ConvertToString::Operation(string_t input) {
79 return input.GetString();
80}
81
82} // namespace duckdb
83