Skip to content

Commit

Permalink
Move _alias_t for CURRENT_* functions inside its struct
Browse files Browse the repository at this point in the history
  • Loading branch information
vaijns authored and rbock committed Dec 7, 2024
1 parent 07cba89 commit 5b3b623
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 33 deletions.
17 changes: 6 additions & 11 deletions include/sqlpp11/current_date.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@

namespace sqlpp
{
struct current_date_alias_t
struct current_date_t : public expression_operators<current_date_t, day_point>, public alias_operators<current_date_t>
{
using _traits = make_traits<day_point, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

struct _alias_t
{
static constexpr const char _literal[] = "current_date_";
Expand All @@ -51,16 +56,6 @@ namespace sqlpp
}
};
};
};

struct current_date_t : public expression_operators<current_date_t, day_point>, public alias_operators<current_date_t>
{
using _traits = make_traits<day_point, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

using _auto_alias_t = current_date_alias_t;

constexpr current_date_t()
{
Expand Down
17 changes: 6 additions & 11 deletions include/sqlpp11/current_time.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@

namespace sqlpp
{
struct current_time_alias_t
struct current_time_t : public expression_operators<current_time_t, time_of_day>, public alias_operators<current_time_t>
{
using _traits = make_traits<time_of_day, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

struct _alias_t
{
static constexpr const char _literal[] = "current_time_";
Expand All @@ -51,16 +56,6 @@ namespace sqlpp
}
};
};
};

struct current_time_t : public expression_operators<current_time_t, time_of_day>, public alias_operators<current_time_t>
{
using _traits = make_traits<time_of_day, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

using _auto_alias_t = current_time_alias_t;

constexpr current_time_t()
{
Expand Down
17 changes: 6 additions & 11 deletions include/sqlpp11/current_timestamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@

namespace sqlpp
{
struct current_timestamp_alias_t
struct current_timestamp_t : public expression_operators<current_timestamp_t, time_point>, public alias_operators<current_timestamp_t>
{
using _traits = make_traits<time_point, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

struct _alias_t
{
static constexpr const char _literal[] = "current_timestamp_";
Expand All @@ -51,16 +56,6 @@ namespace sqlpp
}
};
};
};

struct current_timestamp_t : public expression_operators<current_timestamp_t, time_point>, public alias_operators<current_timestamp_t>
{
using _traits = make_traits<time_point, tag::is_expression, tag::is_selectable>;

using _nodes = detail::type_vector<>;
using _can_be_null = std::false_type;

using _auto_alias_t = current_timestamp_alias_t;

constexpr current_timestamp_t()
{
Expand Down

0 comments on commit 5b3b623

Please sign in to comment.