One of the main motivations of sqlpp11 is to prevent SQL programming mistakes at compile time. The following changes prevent reported mishaps.
*`from(a,b)` not allowed anymore, please use explicit joins
*`where(true)` not allowed anymore, please use `.unconditionally()` or sqlpp::value(true)
*`some_sql_expression and true` not allowed anymore, please use `tab.col == sqlpp::value(true)` if you really want to express this.
*`having(expression)` requires `expression` to be made of aggregates, e.g. columns named in `group_by()` or aggregate functions like `count()` or constant values.
*`where()` and `having` accept only one parameter
__Explicit joins required__:
Up until sqlpp11-0.35 you could write something like
If you want to select/update/remove all rows, earlier versions of sqlpp11 required the use of `where(true)`. Since version 0.36, use `unconditionally()`, for instance:
```
auto result = db(select(all_of(t)).from(t).unconditionally());
```
__Use `sqlpp::value()` to wrap bool values in boolean expressions__
Lets say you had
```
struct X
{
int a;
int b;
};
auto x = X{};
```
Then earlier versions of sqlpp11 would compile the following expression:
```
select(all_of(t)).from(t).where(x.a == x.a or t.b == t.b);
```
What you probably meant was:
```
select(all_of(t)).from(t).where(t.a == x.a and t.b == x.b);
```
In order to prevent this kind of mistake, boolean operators in sql expressions require sqlpp boolean expressions as operators.
The library also requires the types of the left/right hand side operands of a comparison to be different, so that `t.a < t.a` does not compile any more.
In the rare case you really have a bool value that you want to use a boolean sql expression, you have to wrap it in sqlpp::value(x), e.g.
```
select(all_of(t)).from(t).where(sqlpp::value(x.a == 17) and t.b == x.b);
```
__`having()` requires aggregate expressions__
In older versions, the following code was allowed: