31 lines
976 B
C++
31 lines
976 B
C++
#ifndef QUERY_KEY_VALUE_PAIR_HPP
|
|
#define QUERY_KEY_VALUE_PAIR_HPP
|
|
|
|
#include "matador/query/table_column.hpp"
|
|
|
|
#include "matador/utils/placeholder.hpp"
|
|
#include "matador/utils/types.hpp"
|
|
|
|
namespace matador::query::internal {
|
|
|
|
class column_value_pair {
|
|
public:
|
|
column_value_pair(table_column col, utils::database_type value);
|
|
column_value_pair(std::string name, utils::database_type value);
|
|
column_value_pair(const char *name, utils::database_type value);
|
|
column_value_pair(const char *name, utils::placeholder p);
|
|
|
|
friend bool operator==(const column_value_pair &lhs, const column_value_pair &rhs);
|
|
friend bool operator!=(const column_value_pair &lhs, const column_value_pair &rhs);
|
|
|
|
[[nodiscard]] const table_column& col() const;
|
|
[[nodiscard]] const std::variant<utils::placeholder, utils::database_type>& value() const;
|
|
|
|
private:
|
|
table_column column_;
|
|
std::variant<utils::placeholder, utils::database_type> value_;
|
|
};
|
|
|
|
}
|
|
#endif //QUERY_KEY_VALUE_PAIR_HPP
|