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:
@@ -41,6 +41,7 @@ class SQLITE_EXPORT SqliteDatabase
|
||||
{
|
||||
friend class SqliteAbstractTransaction;
|
||||
friend class SqliteStatement;
|
||||
friend class SqliteBackend;
|
||||
|
||||
public:
|
||||
SqliteDatabase();
|
||||
@@ -66,9 +67,10 @@ public:
|
||||
|
||||
void execute(Utils::SmallStringView sqlStatement);
|
||||
|
||||
SqliteDatabaseBackend &backend();
|
||||
|
||||
private:
|
||||
void initializeTables();
|
||||
SqliteDatabaseBackend &backend();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user