forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user