mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-04-28 15:09:26 -05:00
Added a few auto alias tests
This commit is contained 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user