Sqlite: Improve Sqlite wrapper

It is now possible to read values at once.

for (auto [name, value] : statement.tupleValues<String, int>(1000, "foo", 20))
   ....

Change-Id: I3d4bc5218810b4620e1df625126aa490f30bbc71
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2017-08-17 15:33:25 +02:00
parent 8617f497bc
commit 1a25b61576
24 changed files with 769 additions and 277 deletions

View File

@@ -25,32 +25,8 @@
#include "sqlitetable.h"
#include "sqlitecolumn.h"
#include "sqlitedatabase.h"
#include "createtablesqlstatementbuilder.h"
#include "sqlitewritestatement.h"
#include "sqlitetransaction.h"
namespace Sqlite {
void SqliteTable::initialize()
{
try {
CreateTableSqlStatementBuilder createTableSqlStatementBuilder;
createTableSqlStatementBuilder.setTable(m_tableName.clone());
createTableSqlStatementBuilder.setUseWithoutRowId(m_withoutRowId);
createTableSqlStatementBuilder.setColumns(m_sqliteColumns);
SqliteImmediateTransaction transaction(m_sqliteDatabase);
m_sqliteDatabase.execute(createTableSqlStatementBuilder.sqlStatement());
transaction.commit();
m_isReady = true;
} catch (const SqliteException &exception) {
exception.printWarning();
}
}
} // namespace Sqlite