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:
Marco Bubke
2017-07-31 19:44:39 +02:00
parent 71e1f66284
commit a41183f6c7
12 changed files with 166 additions and 39 deletions

View File

@@ -30,7 +30,8 @@
namespace Sqlite {
SqliteDatabase::SqliteDatabase()
: m_journalMode(JournalMode::Wal)
: m_databaseBackend(*this),
m_journalMode(JournalMode::Wal)
{
}