mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-05-07 11:50:01 -05:00
Remove tvin
This was a special feature for a project I was working on long ago. It provided implicit behavior for trivial value (0 or "") which were supposed to be interpreted as NULL. They led to `operator==` potentially being serialized as 'IS NULL'. It makes more sense to introduce explicit helpers, e.g. - equal_or_is_null(col, optional) - not_equal_or_is_not_null(col, optional)
This commit is contained in:
@@ -45,7 +45,7 @@ int Insert(int, char* [])
|
||||
compare(__LINE__, insert_into(bar).default_values(), "INSERT INTO tab_bar DEFAULT VALUES");
|
||||
compare(__LINE__, insert_into(bar).set(bar.beta = "cheesecake", bar.gamma = true),
|
||||
"INSERT INTO tab_bar (beta,gamma) VALUES('cheesecake'," + getTrue() + ")");
|
||||
compare(__LINE__, insert_into(bar).set(bar.beta = ::sqlpp::tvin(""), bar.gamma = true),
|
||||
compare(__LINE__, insert_into(bar).set(bar.beta = ::sqlpp::null, bar.gamma = true),
|
||||
"INSERT INTO tab_bar (beta,gamma) VALUES(NULL," + getTrue() + ")");
|
||||
#if __cplusplus >= 201703L
|
||||
// string_view argument
|
||||
|
||||
@@ -63,7 +63,7 @@ int Where(int, char*[])
|
||||
// Sometimes
|
||||
compare(__LINE__, where(bar.gamma), " WHERE tab_bar.gamma");
|
||||
compare(__LINE__, where(bar.gamma == false), " WHERE (tab_bar.gamma=" + getFalse() + ")");
|
||||
compare(__LINE__, where(bar.gamma == ::sqlpp::tvin(false)), " WHERE (tab_bar.gamma IS NULL)");
|
||||
compare(__LINE__, where(bar.beta.is_null()), " WHERE tab_bar.beta IS NULL");
|
||||
compare(__LINE__, where(bar.beta == "SQL"), " WHERE (tab_bar.beta='SQL')");
|
||||
#if __cplusplus >= 201703L
|
||||
// string_view argument
|
||||
|
||||
Reference in New Issue
Block a user