0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Added optional _post_bind to result fields to allow for conversion in mysql.

This commit is contained in:
rbock 2015-12-19 18:19:10 +01:00
parent f029e5993b
commit 62a4dfc4f5
6 changed files with 40 additions and 0 deletions

View File

@ -44,6 +44,12 @@ namespace sqlpp
{ {
target._bind_boolean_result(index, &this->_value, &this->_is_null); target._bind_boolean_result(index, &this->_value, &this->_is_null);
} }
template <typename Target>
void _post_bind(Target& target, size_t index)
{
target._post_bind_boolean_result(index, &this->_value, &this->_is_null);
}
}; };
} }

View File

@ -45,6 +45,12 @@ namespace sqlpp
{ {
target._bind_date_result(index, &this->_value, &this->_is_null); target._bind_date_result(index, &this->_value, &this->_is_null);
} }
template <typename Target>
void _post_bind(Target& target, size_t index)
{
target._post_bind_date_result(index, &this->_value, &this->_is_null);
}
}; };
template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue> template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue>

View File

@ -46,6 +46,12 @@ namespace sqlpp
{ {
target._bind_floating_point_result(index, &this->_value, &this->_is_null); target._bind_floating_point_result(index, &this->_value, &this->_is_null);
} }
template <typename Target>
void _post_bind(Target& target, size_t index)
{
target._post_bind_floating_point_result(index, &this->_value, &this->_is_null);
}
}; };
} }
#endif #endif

View File

@ -44,6 +44,12 @@ namespace sqlpp
{ {
target._bind_integral_result(index, &this->_value, &this->_is_null); target._bind_integral_result(index, &this->_value, &this->_is_null);
} }
template <typename Target>
void _post_bind(Target& target, size_t index)
{
target._post_bind_integral_result(index, &this->_value, &this->_is_null);
}
}; };
} }
#endif #endif

View File

@ -49,6 +49,16 @@ namespace sqlpp
this->_value = {text, len}; this->_value = {text, len};
this->_is_null = (len == 0); this->_is_null = (len == 0);
} }
template <typename Target>
void _post_bind(Target& target, size_t index)
{
const char* text{nullptr};
size_t len{};
target._post_bind_text_result(index, &text, &len);
this->_value = {text, len};
this->_is_null = (len == 0);
}
}; };
template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue> template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue>

View File

@ -45,6 +45,12 @@ namespace sqlpp
{ {
target._bind_date_time_result(i, &this->_value, &this->_is_null); target._bind_date_time_result(i, &this->_value, &this->_is_null);
} }
template <typename Target>
void _post_bind(Target& target, size_t i)
{
target._post_bind_date_time_result(i, &this->_value, &this->_is_null);
}
}; };
template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue> template <typename Db, typename NameType, bool CanBeNull, bool NullIsTrivialValue>