forked from qt-creator/qt-creator
Sqlite: Cleanup sqlite statement
Change-Id: I727a95491a45fe01bf59821d4f451f25483745ed Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -173,9 +173,7 @@ public:
|
|||||||
resetter.reset();
|
resetter.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void bindValues()
|
void bindValues() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... ValueType>
|
template<typename... ValueType>
|
||||||
void bindValues(const ValueType&... values)
|
void bindValues(const ValueType&... values)
|
||||||
@@ -389,25 +387,12 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename ValueType, typename... ValueTypes>
|
template<typename ValueType, typename... ValueTypes>
|
||||||
void bindValuesByIndex(int index, const ValueType &value, const ValueTypes&... values)
|
void bindValuesByIndex(int index, const ValueType &value, const ValueTypes &...values)
|
||||||
{
|
{
|
||||||
BaseStatement::bind(index, value);
|
BaseStatement::bind(index, value);
|
||||||
bindValuesByIndex(index + 1, values...);
|
bindValuesByIndex(index + 1, values...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TupleType, std::size_t... ColumnIndices>
|
|
||||||
void bindTupleValuesElement(const TupleType &tuple, std::index_sequence<ColumnIndices...>)
|
|
||||||
{
|
|
||||||
bindValues(std::get<ColumnIndices>(tuple)...);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename TupleType,
|
|
||||||
typename ColumnIndices = std::make_index_sequence<std::tuple_size<TupleType>::value>>
|
|
||||||
void bindTupleValues(const TupleType &element)
|
|
||||||
{
|
|
||||||
bindTupleValuesElement(element, ColumnIndices());
|
|
||||||
}
|
|
||||||
|
|
||||||
void setMaximumResultCount(std::size_t count)
|
void setMaximumResultCount(std::size_t count)
|
||||||
{
|
{
|
||||||
m_maximumResultCount = std::max(m_maximumResultCount, count);
|
m_maximumResultCount = std::max(m_maximumResultCount, count);
|
||||||
|
|||||||
Reference in New Issue
Block a user