forked from qt-creator/qt-creator
		
	Sqlite: Introduce BindParameterCount template parameter
The BindParameterCount is checked at compile time and then again for the construction of the statement. So we provide an early error instead of an some error later or even stranger behavior. Change-Id: I860ca1f78645c222ae1accf5c7a469c77befc3bd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
		| @@ -121,9 +121,10 @@ protected: | ||||
|                                                   database}; | ||||
|     Sqlite::ReadStatement<2> selectValuesStatement{"SELECT key, value FROM data ORDER BY key", | ||||
|                                                    database}; | ||||
|     Sqlite::WriteStatement insertStatement{"INSERT INTO data(key, value) VALUES (?1, ?2)", database}; | ||||
|     Sqlite::WriteStatement updateStatement{"UPDATE data SET value = ?2 WHERE key=?1", database}; | ||||
|     Sqlite::WriteStatement deleteStatement{"DELETE FROM data WHERE key=?", database}; | ||||
|     Sqlite::WriteStatement<2> insertStatement{"INSERT INTO data(key, value) VALUES (?1, ?2)", | ||||
|                                               database}; | ||||
|     Sqlite::WriteStatement<2> updateStatement{"UPDATE data SET value = ?2 WHERE key=?1", database}; | ||||
|     Sqlite::WriteStatement<1> deleteStatement{"DELETE FROM data WHERE key=?", database}; | ||||
|     std::function<void(const KeyValue &keyValue)> insert{ | ||||
|         [&](const KeyValue &keyValue) { insertStatement.write(keyValue.key, keyValue.value); }}; | ||||
|     std::function<Sqlite::UpdateChange(KeyValueView keyValueView, const KeyValue &keyValue)> update{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user