forked from qt-creator/qt-creator
Sqlite: Remove unused code
Binding by names is slower and we never used it. Change-Id: Ia6b9b78401f8c2711be34b667ac6f08b44418773 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -223,25 +223,6 @@ void BaseStatement::bind(int index, const Value &value)
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
void BaseStatement::bind(Utils::SmallStringView name, Type value)
|
||||
{
|
||||
int index = bindingIndexForName(name);
|
||||
checkBindingName(index);
|
||||
bind(index, value);
|
||||
}
|
||||
|
||||
template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, int value);
|
||||
template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, long value);
|
||||
template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, long long value);
|
||||
template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, double value);
|
||||
template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, Utils::SmallStringView text);
|
||||
|
||||
int BaseStatement::bindingIndexForName(Utils::SmallStringView name) const
|
||||
{
|
||||
return sqlite3_bind_parameter_index(m_compiledStatement.get(), name.data());
|
||||
}
|
||||
|
||||
void BaseStatement::prepare(Utils::SmallStringView sqlStatement)
|
||||
{
|
||||
int resultCode;
|
||||
|
||||
@@ -91,11 +91,6 @@ public:
|
||||
bind(index, static_cast<long long>(value));
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
void bind(Utils::SmallStringView name, Type fetchValue);
|
||||
|
||||
int bindingIndexForName(Utils::SmallStringView name) const;
|
||||
|
||||
void prepare(Utils::SmallStringView sqlStatement);
|
||||
void waitForUnlockNotify() const;
|
||||
|
||||
@@ -140,12 +135,6 @@ private:
|
||||
mutable bool m_isReadyToFetchValues;
|
||||
};
|
||||
|
||||
extern template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, int value);
|
||||
extern template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, long value);
|
||||
extern template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, long long value);
|
||||
extern template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, double value);
|
||||
extern template SQLITE_EXPORT void BaseStatement::bind(Utils::SmallStringView name, Utils::SmallStringView text);
|
||||
|
||||
template <> SQLITE_EXPORT int BaseStatement::fetchValue<int>(int column) const;
|
||||
template <> SQLITE_EXPORT long BaseStatement::fetchValue<long>(int column) const;
|
||||
template <> SQLITE_EXPORT long long BaseStatement::fetchValue<long long>(int column) const;
|
||||
@@ -187,21 +176,6 @@ public:
|
||||
resetter.reset();
|
||||
}
|
||||
|
||||
template<typename... ValueType>
|
||||
void bindNameValues(const ValueType&... values)
|
||||
{
|
||||
bindValuesByName(values...);
|
||||
}
|
||||
|
||||
template<typename... ValueType>
|
||||
void writeNamed(const ValueType&... values)
|
||||
{
|
||||
Resetter resetter{*this};
|
||||
bindValuesByName(values...);
|
||||
BaseStatement::next();
|
||||
resetter.reset();
|
||||
}
|
||||
|
||||
template <typename ResultType,
|
||||
int ResultTypeCount = 1>
|
||||
std::vector<ResultType> values(std::size_t reserveSize)
|
||||
@@ -413,19 +387,6 @@ private:
|
||||
bindValuesByIndex(index + 1, values...);
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
void bindValuesByName(Utils::SmallStringView name, const ValueType &value)
|
||||
{
|
||||
BaseStatement::bind(BaseStatement::bindingIndexForName(name), value);
|
||||
}
|
||||
|
||||
template<typename ValueType, typename... ValueTypes>
|
||||
void bindValuesByName(Utils::SmallStringView name, const ValueType &value, const ValueTypes&... values)
|
||||
{
|
||||
BaseStatement::bind(BaseStatement::bindingIndexForName(name), value);
|
||||
bindValuesByName(values...);
|
||||
}
|
||||
|
||||
template <typename TupleType, std::size_t... ColumnIndices>
|
||||
void bindTupleValuesElement(const TupleType &tuple, std::index_sequence<ColumnIndices...>)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,6 @@ public:
|
||||
using StatementImplementation::values;
|
||||
using StatementImplementation::toValue;
|
||||
using StatementImplementation::write;
|
||||
using StatementImplementation::writeNamed;
|
||||
};
|
||||
|
||||
} // namespace Sqlite
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
using StatementImplementation::execute;
|
||||
using StatementImplementation::database;
|
||||
using StatementImplementation::write;
|
||||
using StatementImplementation::writeNamed;
|
||||
|
||||
protected:
|
||||
void checkIsWritableStatement();
|
||||
|
||||
Reference in New Issue
Block a user