query/include/matador/sql/key_value_pair.hpp

34 lines
654 B
C++

#ifndef QUERY_KEY_VALUE_PAIR_HPP
#define QUERY_KEY_VALUE_PAIR_HPP
#include <any>
#include <string>
#include <variant>
namespace matador::sql {
using any_type = std::variant<
char, short, int, long, long long,
unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long,
bool,
float, double,
const char*,
std::string>;
class key_value_pair
{
public:
key_value_pair(const std::string &name, any_type value);
key_value_pair(const char *name, any_type value);
const std::string& name() const;
const any_type& value() const;
private:
std::string name_;
any_type value_;
};
}
#endif //QUERY_KEY_VALUE_PAIR_HPP