renamed binary_operator to be pascal case

This commit is contained in:
sascha 2026-05-29 15:09:11 +02:00
parent 68d67b17b7
commit bd06034ebf
5 changed files with 33 additions and 33 deletions

View File

@ -8,12 +8,12 @@
namespace matador::query {
enum class binary_operator {
EQUALS,
NOT_EQUALS,
GREATER_THAN,
GREATER_THAN_OR_EQUAL,
LESS_THAN,
LESS_THAN_OR_EQUAL,
Equals,
NotEquals,
GreaterThan,
GreaterThanOrEqual,
LessThan,
LessThanOrEqual,
};
class binary_criteria final : public abstract_column_criteria {

View File

@ -20,33 +20,33 @@ class table_column;
template<class Type>
std::enable_if_t<!std::is_base_of_v<fetchable_query, std::decay_t<Type>>, criteria_ptr>
operator==(const table_column &col, Type val) {
return std::make_unique<binary_criteria>(col, binary_operator::EQUALS, utils::value(val));
return std::make_unique<binary_criteria>(col, binary_operator::Equals, utils::value(val));
}
template<class Type>
std::enable_if_t<!std::is_base_of_v<fetchable_query, std::decay_t<Type>>, criteria_ptr>
operator!=(const table_column &col, Type val) {
return std::make_unique<binary_criteria>(col, binary_operator::NOT_EQUALS, utils::value(val));
return std::make_unique<binary_criteria>(col, binary_operator::NotEquals, utils::value(val));
}
template<class Type>
criteria_ptr operator>(const table_column &col, Type val) {
return std::make_unique<binary_criteria>(col, binary_operator::GREATER_THAN, utils::value(val));
return std::make_unique<binary_criteria>(col, binary_operator::GreaterThan, utils::value(val));
}
template<class Type>
criteria_ptr operator>=(const table_column &col, Type val) {
return std::make_unique<binary_criteria>(col, binary_operator::GREATER_THAN_OR_EQUAL, utils::value(val));
return std::make_unique<binary_criteria>(col, binary_operator::GreaterThanOrEqual, utils::value(val));
}
template<class Type>
criteria_ptr operator<(const table_column &col, Type val) {
return std::make_unique<binary_criteria>(col, binary_operator::LESS_THAN, utils::value(val));
return std::make_unique<binary_criteria>(col, binary_operator::LessThan, utils::value(val));
}
template<class Type>
criteria_ptr operator<=(const table_column &col, Type val) {
return std::make_unique<binary_criteria>(col, binary_operator::LESS_THAN_OR_EQUAL, utils::value(val));
return std::make_unique<binary_criteria>(col, binary_operator::LessThanOrEqual, utils::value(val));
}
criteria_ptr operator==(const table_column &col_left, const table_column &col_right);

View File

@ -13,61 +13,61 @@ namespace matador::query {
criteria_ptr operator==(const table_column &col, const utils::identifier &id) {
utils::identifier_to_value_converter conv;
return std::make_unique<binary_criteria>(col, binary_operator::EQUALS, conv.convert(id));
return std::make_unique<binary_criteria>(col, binary_operator::Equals, conv.convert(id));
}
criteria_ptr operator!=(const table_column &col, const utils::identifier &id) {
utils::identifier_to_value_converter conv;
return std::make_unique<binary_criteria>(col, binary_operator::NOT_EQUALS, conv.convert(id));
return std::make_unique<binary_criteria>(col, binary_operator::NotEquals, conv.convert(id));
}
criteria_ptr operator==(const table_column &col, utils::placeholder p) {
return std::make_unique<binary_criteria>(col, binary_operator::EQUALS, p);
return std::make_unique<binary_criteria>(col, binary_operator::Equals, p);
}
criteria_ptr operator!=(const table_column &col, utils::placeholder p) {
return std::make_unique<binary_criteria>(col, binary_operator::NOT_EQUALS, p);
return std::make_unique<binary_criteria>(col, binary_operator::NotEquals, p);
}
criteria_ptr operator>(const table_column &col, utils::placeholder p) {
return std::make_unique<binary_criteria>(col, binary_operator::GREATER_THAN, p);
return std::make_unique<binary_criteria>(col, binary_operator::GreaterThan, p);
}
criteria_ptr operator>=(const table_column &col, utils::placeholder p) {
return std::make_unique<binary_criteria>(col, binary_operator::GREATER_THAN_OR_EQUAL, p);
return std::make_unique<binary_criteria>(col, binary_operator::GreaterThanOrEqual, p);
}
criteria_ptr operator<(const table_column &col, utils::placeholder p) {
return std::make_unique<binary_criteria>(col, binary_operator::LESS_THAN, p);
return std::make_unique<binary_criteria>(col, binary_operator::LessThan, p);
}
criteria_ptr operator<=(const table_column &col, utils::placeholder p) {
return std::make_unique<binary_criteria>(col, binary_operator::LESS_THAN_OR_EQUAL, p);
return std::make_unique<binary_criteria>(col, binary_operator::LessThanOrEqual, p);
}
criteria_ptr operator==( const table_column& col_left, const table_column& col_right ) {
return std::make_unique<binary_column_criteria>(col_left, binary_operator::EQUALS, col_right);
return std::make_unique<binary_column_criteria>(col_left, binary_operator::Equals, col_right);
}
criteria_ptr operator!=( const table_column& col_left, const table_column& col_right ) {
return std::make_unique<binary_column_criteria>(col_left, binary_operator::NOT_EQUALS, col_right);
return std::make_unique<binary_column_criteria>(col_left, binary_operator::NotEquals, col_right);
}
criteria_ptr operator>( const table_column& col_left, const table_column& col_right ) {
return std::make_unique<binary_column_criteria>(col_left, binary_operator::GREATER_THAN, col_right);
return std::make_unique<binary_column_criteria>(col_left, binary_operator::GreaterThan, col_right);
}
criteria_ptr operator>=( const table_column& col_left, const table_column& col_right ) {
return std::make_unique<binary_column_criteria>(col_left, binary_operator::GREATER_THAN_OR_EQUAL, col_right);
return std::make_unique<binary_column_criteria>(col_left, binary_operator::GreaterThanOrEqual, col_right);
}
criteria_ptr operator<( const table_column& col_left, const table_column& col_right ) {
return std::make_unique<binary_column_criteria>(col_left, binary_operator::LESS_THAN, col_right);
return std::make_unique<binary_column_criteria>(col_left, binary_operator::LessThan, col_right);
}
criteria_ptr operator<=( const table_column& col_left, const table_column& col_right ) {
return std::make_unique<binary_column_criteria>(col_left, binary_operator::LESS_THAN_OR_EQUAL, col_right);
return std::make_unique<binary_column_criteria>(col_left, binary_operator::LessThanOrEqual, col_right);
}
criteria_ptr operator&&(criteria_ptr left, criteria_ptr right) {

View File

@ -18,12 +18,12 @@
namespace matador::query {
namespace detail {
static const utils::enum_mapper<binary_operator> BinaryOperatorEnum({
{binary_operator::EQUALS, "="},
{binary_operator::NOT_EQUALS, "<>"},
{binary_operator::GREATER_THAN, ">"},
{binary_operator::GREATER_THAN_OR_EQUAL, ">="},
{binary_operator::LESS_THAN, "<"},
{binary_operator::LESS_THAN_OR_EQUAL, "<="},
{binary_operator::Equals, "="},
{binary_operator::NotEquals, "<>"},
{binary_operator::GreaterThan, ">"},
{binary_operator::GreaterThanOrEqual, ">="},
{binary_operator::LessThan, "<"},
{binary_operator::LessThanOrEqual, "<="},
});
}

View File

@ -83,7 +83,7 @@ void select_query_builder::append_join(const table_column &left, const table_col
using namespace matador::query;
entity_query_data_.joins.push_back({
right.table(),
std::make_unique<binary_column_criteria>(left, binary_operator::EQUALS, right)
std::make_unique<binary_column_criteria>(left, binary_operator::Equals, right)
});
}
}