mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-04 20:20:59 -06:00
std::string_view should also be assignable in prepared statements
This commit is contained in:
committed by
Roland Bock
parent
9412851408
commit
38aba217d4
@@ -33,6 +33,10 @@
|
||||
#include <sqlpp11/data_types/text/wrap_operand.h>
|
||||
#include <sqlpp11/data_types/text/operand.h>
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
namespace sqlpp
|
||||
{
|
||||
template <>
|
||||
@@ -47,6 +51,22 @@ namespace sqlpp
|
||||
{
|
||||
target._bind_text_parameter(index, &_value, _is_null);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
parameter_value_base& operator=(const std::string_view& val)
|
||||
{
|
||||
_value = val;
|
||||
_is_null = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
parameter_value_base& operator=(const char* val)
|
||||
{
|
||||
_value = val;
|
||||
_is_null = false;
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
} // namespace sqlpp
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user