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

Table aliases must not use braces for tables but for sub selects

This commit is contained in:
rbock 2015-02-15 16:54:03 +01:00
parent 9e1ecaf15a
commit 437607813c

View File

@ -74,9 +74,12 @@ namespace sqlpp
static Context& _(const T& t, Context& context) static Context& _(const T& t, Context& context)
{ {
if (requires_braces_t<T>::value)
context << "("; context << "(";
serialize(t._table, context); serialize(t._table, context);
context << ") AS " << name_of<T>::char_ptr(); if (requires_braces_t<T>::value)
context << ")";
context << " AS " << name_of<T>::char_ptr();
return context; return context;
} }
}; };