0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Moved serialize code to dynamic_select_column_list.h

This commit is contained in:
rbock 2016-01-24 15:39:51 +01:00
parent 1b2020a5d2
commit 6e60dc6630
2 changed files with 31 additions and 31 deletions

View File

@ -70,6 +70,37 @@ namespace sqlpp
return true; return true;
} }
}; };
template <typename Context, typename Db>
struct serializer_t<Context, dynamic_select_column_list<Db>>
{
using T = dynamic_select_column_list<Db>;
static Context& _(const T& t, Context& context)
{
bool first = true;
for (const auto column : t._dynamic_columns)
{
if (first)
first = false;
else
context << ',';
serialize(column, context);
}
return context;
}
};
template <typename Context>
struct serializer_t<Context, dynamic_select_column_list<void>>
{
using T = dynamic_select_column_list<void>;
static Context& _(const T&, Context& context)
{
return context;
}
};
} }
#endif #endif

View File

@ -66,37 +66,6 @@ namespace sqlpp
}; };
} }
template <typename Context, typename Db>
struct serializer_t<Context, dynamic_select_column_list<Db>>
{
using T = dynamic_select_column_list<Db>;
static Context& _(const T& t, Context& context)
{
bool first = true;
for (const auto column : t._dynamic_columns)
{
if (first)
first = false;
else
context << ',';
serialize(column, context);
}
return context;
}
};
template <typename Context>
struct serializer_t<Context, dynamic_select_column_list<void>>
{
using T = dynamic_select_column_list<void>;
static Context& _(const T&, Context& context)
{
return context;
}
};
// SELECTED COLUMNS DATA // SELECTED COLUMNS DATA
template <typename Database, typename... Columns> template <typename Database, typename... Columns>
struct select_column_list_data_t struct select_column_list_data_t