41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#include "matador/query/internal/column_value_pair.hpp"
|
|
|
|
#include <utility>
|
|
|
|
namespace matador::query::internal {
|
|
|
|
column_value_pair::column_value_pair(std::string name, utils::database_type value)
|
|
: column_(std::move(name))
|
|
, value_(std::move(value)) {
|
|
}
|
|
|
|
column_value_pair::column_value_pair(const table_column &col, utils::database_type value)
|
|
: column_(col)
|
|
, value_(std::move(value)) {
|
|
}
|
|
|
|
column_value_pair::column_value_pair(const char *name, utils::database_type value)
|
|
: column_(name)
|
|
, value_(std::move(value)) {
|
|
}
|
|
|
|
column_value_pair::column_value_pair( const char* name, utils::placeholder p )
|
|
: column_(name)
|
|
, value_(p) {}
|
|
|
|
const table_column &column_value_pair::col() const {
|
|
return column_;
|
|
}
|
|
|
|
const std::variant<utils::placeholder, utils::database_type>& column_value_pair::value() const {
|
|
return value_;
|
|
}
|
|
|
|
bool operator==( const column_value_pair& lhs, const column_value_pair& rhs ) {
|
|
return lhs.column_.equals(rhs.column_) && lhs.value_ == rhs.value_;
|
|
}
|
|
|
|
bool operator!=( const column_value_pair& lhs, const column_value_pair& rhs ) {
|
|
return !( lhs == rhs );
|
|
}
|
|
} |