mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Added a few auto alias tests
This commit is contained in:
parent
d06b386e03
commit
5e52a4da46
@ -44,7 +44,7 @@ namespace sqlpp
|
||||
template <typename T>
|
||||
struct _member_t
|
||||
{
|
||||
T in;
|
||||
T not_in;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -44,5 +44,12 @@ int As(int, char* [])
|
||||
compare(__LINE__, (count(foo.omega) - bar.alpha).as(cheese), "(COUNT(tab_foo.omega)-tab_bar.alpha) AS cheese");
|
||||
compare(__LINE__, (count(foo.omega) - uint32_t(17)).as(cheese), "(COUNT(tab_foo.omega)-17) AS cheese");
|
||||
|
||||
// Auto alias
|
||||
compare(__LINE__, select(max(bar.alpha)), "SELECT MAX(tab_bar.alpha) AS max_");
|
||||
compare(__LINE__, select(max(bar.alpha).as(cheese)), "SELECT MAX(tab_bar.alpha) AS cheese");
|
||||
compare(__LINE__, select(max(bar.alpha)).from(bar).unconditionally().as(cheese),
|
||||
"(SELECT MAX(tab_bar.alpha) AS max_ FROM tab_bar) AS cheese");
|
||||
compare(__LINE__, select(max(bar.alpha)).from(bar).unconditionally().as(cheese).max, "cheese.max_");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user