Sqlite: Disable value method for fundamentals

There is optionalValue which can handle a null value. ints and floats
can be initialize to zero but you cannot be sure that this value comes
from the database, is a empty value. So it's better to force
the use of optionalValue for ints and floats. In that case empty has
to be handled.

Change-Id: Id5c5db57a8d3335d91911824d06f388ed054df9e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
Marco Bubke
2021-06-24 14:14:24 +02:00
parent 584f0476ec
commit 091c7a0093
2 changed files with 11 additions and 3 deletions

View File

@@ -210,7 +210,7 @@ public:
}
template<typename ResultType, typename... QueryTypes>
auto value(const QueryTypes &...queryValues)
std::enable_if_t<!std::is_function_v<ResultType>, ResultType> value(const QueryTypes &...queryValues)
{
Resetter resetter{this};
ResultType resultValue;