38 lines
910 B
C++
38 lines
910 B
C++
#include "matador/sql/interface/query_result_reader.hpp"
|
|
|
|
#include "matador/utils/basic_types.hpp"
|
|
#include "matador/utils/convert.hpp"
|
|
#include "matador/utils/string.hpp"
|
|
#include "matador/utils/value.hpp"
|
|
|
|
namespace matador::sql {
|
|
|
|
template < typename Type >
|
|
void convert(const char *val_str, utils::value &val)
|
|
{
|
|
if (val_str == nullptr) {
|
|
val = utils::value(Type{});
|
|
return;
|
|
}
|
|
Type local_val{};
|
|
const auto res = utils::to<Type>(val_str);
|
|
val = *res;
|
|
}
|
|
|
|
// utils::blob query_result_reader::read_blob(const size_t index)
|
|
// {
|
|
// const auto *data = column(index);
|
|
// if (data == nullptr) {
|
|
// return {};
|
|
// }
|
|
// const auto len = strlen(data);
|
|
// const auto *bytes = reinterpret_cast<const unsigned char*>(data);
|
|
// return utils::blob{bytes, bytes+len};
|
|
// }
|
|
|
|
// utils::attribute_reader &query_result_reader::result_binder()
|
|
// {
|
|
// return empty_result_binder_;
|
|
// }
|
|
|
|
} |