forked from qt-creator/qt-creator
Sqlite: Add variadic bind and write functions
You can now write
SqliteWriteStatement statement("UPDATE test SET name=?, number=?
WHERE rowid=?", database);
statement.write("see", 7.23, 1);
and
SqliteWriteStatement statement("UPDATE test SET name=@name, number=@number
WHERE rowid=@id", database);
statement.writeNamed("@name", "see", "@number", 7.23, "@id", 1);
This is more type safe than using variants and performant too.
Change-Id: Ie1ed2a6d326b956be5c4ec056214f3f5b1531f45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -34,12 +34,17 @@ class SQLITE_EXPORT SqliteWriteStatement : private SqliteStatement
|
||||
public:
|
||||
explicit SqliteWriteStatement(Utils::SmallStringView sqlStatement, SqliteDatabase &database);
|
||||
|
||||
using SqliteStatement::step;
|
||||
using SqliteStatement::execute;
|
||||
using SqliteStatement::reset;
|
||||
using SqliteStatement::bind;
|
||||
using SqliteStatement::bindValues;
|
||||
using SqliteStatement::bindNameValues;
|
||||
using SqliteStatement::bindingIndexForName;
|
||||
using SqliteStatement::setBindingColumnNames;
|
||||
using SqliteStatement::bindingColumnNames;
|
||||
using SqliteStatement::database;
|
||||
using SqliteStatement::write;
|
||||
using SqliteStatement::writeNamed;
|
||||
|
||||
protected:
|
||||
void checkIsWritableStatement();
|
||||
|
||||
Reference in New Issue
Block a user