16 typedef enum Conditional {
33 Where(
const std::string& column,
const Condition condition,
const std::string& value) :
34 m_column(column), m_condition(condition), m_and(0), m_or(0)
42 m_in.push_back(value);
45 Where(
const std::string& column,
const Condition condition,
const std::string& value,
Where *andCondition) :
46 m_column(column), m_condition(condition), m_and(andCondition), m_or(0)
54 m_in.push_back(value);
57 Where(
const std::string& column,
const Condition condition) :
58 m_column(column), m_condition(condition), m_and(0), m_or(0)
60 if (condition != IsNull && condition != NotNull)
62 throw std::runtime_error(
"Missing value in where clause");
65 Where(
const std::string& column,
const Condition condition,
Where *andCondition) :
66 m_column(column), m_condition(condition), m_and(andCondition), m_or(0)
68 if (condition != IsNull && condition != NotNull)
70 throw std::runtime_error(
"Missing value in where clause");
74 void andWhere(
Where *condition) { m_and = condition; };
75 void orWhere(
Where *condition) { m_or = condition; };
76 void addIn(
const std::string& value)
78 if (m_condition == In)
80 m_in.push_back(value);
83 const std::string
toJSON()
const;
87 const std::string m_column;
88 const Condition m_condition;
92 std::vector<std::string>
~Where()
Where clause destructor.
Definition: where.cpp:20
const std::string toJSON() const
Return the JSON payload for a where clause.
Definition: where.cpp:35
Where clause in a selection of records.
Definition: where.h:31