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:
parent
1b2020a5d2
commit
6e60dc6630
@ -70,6 +70,37 @@ namespace sqlpp
|
||||
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
|
||||
|
@ -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
|
||||
template <typename Database, typename... Columns>
|
||||
struct select_column_list_data_t
|
||||
|
Loading…
Reference in New Issue
Block a user