From e7590dc004281b0f6a05d5f98e94ad6bb583a30c Mon Sep 17 00:00:00 2001 From: Leon De Andrade Date: Sat, 4 Dec 2021 10:52:26 +0100 Subject: [PATCH] Add unsigned bind to postgresql (#395) --- include/sqlpp11/postgresql/bind_result.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/sqlpp11/postgresql/bind_result.h b/include/sqlpp11/postgresql/bind_result.h index db8d3b0d..752da1f3 100644 --- a/include/sqlpp11/postgresql/bind_result.h +++ b/include/sqlpp11/postgresql/bind_result.h @@ -100,6 +100,7 @@ namespace sqlpp void _bind_boolean_result(size_t index, signed char* value, bool* is_null); void _bind_floating_point_result(size_t index, double* value, bool* is_null); void _bind_integral_result(size_t index, int64_t* value, bool* is_null); + void _bind_unsigned_integral_result(size_t index, uint64_t* value, bool* is_null); void _bind_text_result(size_t index, const char** value, size_t* len); void _bind_date_result(size_t index, ::sqlpp::chrono::day_point* value, bool* is_null); void _bind_date_time_result(size_t index, ::sqlpp::chrono::microsecond_point* value, bool* is_null); @@ -190,6 +191,18 @@ namespace sqlpp *value = _handle->result.getValue(_handle->count, index); } + inline void bind_result_t::_bind_unsigned_integral_result(size_t _index, uint64_t* value, bool* is_null) + { + auto index = static_cast(_index); + if (_handle->debug()) + { + std::cerr << "PostgreSQL debug: binding unsigned integral result at index: " << index << std::endl; + } + + *is_null = _handle->result.isNull(_handle->count, index); + *value = _handle->result.getValue(_handle->count, index); + } + inline void bind_result_t::_bind_text_result(size_t _index, const char** value, size_t* len) { auto index = static_cast(_index);