|
|
|
@@ -59,7 +59,7 @@ template <> struct data_type_traits<nullptr_t, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, nullptr_t &/*value*/);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, nullptr_t &/*value*/);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, nullptr_t &/*value*/);
|
|
|
|
|
inline static any_type create_value(char &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const char &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<char, void>
|
|
|
|
@@ -68,7 +68,7 @@ template <> struct data_type_traits<char, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, char &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, char &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, char &value);
|
|
|
|
|
inline static any_type create_value(char &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const char &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<short, void>
|
|
|
|
@@ -77,7 +77,7 @@ template <> struct data_type_traits<short, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, short &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, short &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, short &value);
|
|
|
|
|
inline static any_type create_value(short &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const short &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<int, void>
|
|
|
|
@@ -86,7 +86,7 @@ template <> struct data_type_traits<int, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, int &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, int &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, int &value);
|
|
|
|
|
inline static any_type create_value(int &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const int &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<long, void>
|
|
|
|
@@ -95,7 +95,7 @@ template <> struct data_type_traits<long, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, long &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, long &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, long &value);
|
|
|
|
|
inline static any_type create_value(long &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const long &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<long long, void>
|
|
|
|
@@ -104,7 +104,7 @@ template <> struct data_type_traits<long long, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, long long &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, long long &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, long long &value);
|
|
|
|
|
inline static any_type create_value(long long &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const long long &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<unsigned char, void>
|
|
|
|
@@ -113,7 +113,7 @@ template <> struct data_type_traits<unsigned char, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, unsigned char &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, unsigned char &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, unsigned char &value);
|
|
|
|
|
inline static any_type create_value(unsigned char &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const unsigned char &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<unsigned short, void>
|
|
|
|
@@ -122,7 +122,7 @@ template <> struct data_type_traits<unsigned short, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, unsigned short &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, unsigned short &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, unsigned short &value);
|
|
|
|
|
inline static any_type create_value(unsigned short &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const unsigned short &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<unsigned int, void>
|
|
|
|
@@ -131,7 +131,7 @@ template <> struct data_type_traits<unsigned int, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, unsigned int &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, unsigned int &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, unsigned int &value);
|
|
|
|
|
inline static any_type create_value(unsigned int &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const unsigned int &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<unsigned long, void>
|
|
|
|
@@ -140,7 +140,7 @@ template <> struct data_type_traits<unsigned long, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, unsigned long &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, unsigned long &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, unsigned long &value);
|
|
|
|
|
inline static any_type create_value(unsigned long &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const unsigned long &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<unsigned long long, void>
|
|
|
|
@@ -149,7 +149,7 @@ template <> struct data_type_traits<unsigned long long, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, unsigned long long &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, unsigned long long &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, unsigned long long &value);
|
|
|
|
|
inline static any_type create_value(unsigned long long &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const unsigned long long &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<bool, void>
|
|
|
|
@@ -158,7 +158,7 @@ template <> struct data_type_traits<bool, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, bool &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, bool &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, bool &value);
|
|
|
|
|
inline static any_type create_value(bool &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const bool &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<float, void>
|
|
|
|
@@ -167,7 +167,7 @@ template <> struct data_type_traits<float, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, float &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, float &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, float &value);
|
|
|
|
|
inline static any_type create_value(float &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const float &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<double, void>
|
|
|
|
@@ -176,7 +176,7 @@ template <> struct data_type_traits<double, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, double &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, double &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, double &value);
|
|
|
|
|
inline static any_type create_value(double &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const double &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<const char*, void>
|
|
|
|
@@ -203,7 +203,7 @@ template <> struct data_type_traits<std::string, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, std::string &value, size_t size);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, std::string &value, size_t size = 0);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, std::string &value, size_t size = 0);
|
|
|
|
|
inline static any_type create_value(std::string &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const std::string &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <> struct data_type_traits<utils::blob, void>
|
|
|
|
@@ -212,7 +212,7 @@ template <> struct data_type_traits<utils::blob, void>
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, utils::blob &value);
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, utils::blob &value);
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, utils::blob &value);
|
|
|
|
|
inline static any_type create_value(utils::blob &value) { return value; }
|
|
|
|
|
inline static any_type create_value(const utils::blob &value) { return value; }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//template <> struct data_type_traits<matador::date>
|
|
|
|
@@ -232,7 +232,7 @@ template <> struct data_type_traits<utils::blob, void>
|
|
|
|
|
//};
|
|
|
|
|
|
|
|
|
|
template < typename EnumType >
|
|
|
|
|
struct data_type_traits<EnumType, typename std::enable_if<std::is_enum<EnumType>::value>::type>
|
|
|
|
|
struct data_type_traits<EnumType, std::enable_if_t<std::is_enum_v<EnumType>>>
|
|
|
|
|
{
|
|
|
|
|
inline static data_type_t builtin_type(std::size_t /*size*/) { return data_type_t::type_int; }
|
|
|
|
|
static void read_value(query_result_reader &reader, const char *id, size_t index, EnumType &value)
|
|
|
|
@@ -241,13 +241,15 @@ struct data_type_traits<EnumType, typename std::enable_if<std::is_enum<EnumType>
|
|
|
|
|
}
|
|
|
|
|
static void bind_value(parameter_binder &binder, size_t index, EnumType &value)
|
|
|
|
|
{
|
|
|
|
|
data_type_traits<int>::bind_value(binder, index, (int&)value);
|
|
|
|
|
data_type_traits<int>::bind_value(binder, index, static_cast<int&>(value));
|
|
|
|
|
}
|
|
|
|
|
static void bind_result_value(result_parameter_binder &binder, size_t index, EnumType &value)
|
|
|
|
|
{
|
|
|
|
|
data_type_traits<int>::bind_result_value(binder, index, (int&)value);
|
|
|
|
|
data_type_traits<int>::bind_result_value(binder, index, static_cast<int&>(value));
|
|
|
|
|
}
|
|
|
|
|
static any_type create_value(const EnumType &value) {
|
|
|
|
|
return static_cast<int>(value);
|
|
|
|
|
}
|
|
|
|
|
inline static any_type create_value(EnumType &value) { return (int)value; }
|
|
|
|
|
};
|
|
|
|
|
/// @endcond
|
|
|
|
|
|
|
|
|
|