Revision 94bf67c7
Von Christian Ehringfeld vor mehr als 10 Jahren hinzugefügt
| src/database.cpp | ||
|---|---|---|
|
return this->connectionName;
|
||
|
}
|
||
|
|
||
|
bool Database::transaction(const QString &query) {
|
||
|
bool rc = false;
|
||
|
if (supportTransactions) {
|
||
|
this->startTransaction();
|
||
|
QSqlQuery sqlquery = QSqlQuery(this->database);
|
||
|
sqlquery.exec(query);
|
||
|
this->commitTransaction();
|
||
|
} else {
|
||
|
rc = this->exec(query);
|
||
|
}
|
||
|
qDebug() << "Executed Query:" << query;
|
||
|
return rc;
|
||
|
}
|
||
|
|
||
|
QSqlQuery Database::getQuery() {
|
||
|
return QSqlQuery(this->database);
|
||
|
}
|
||
| ... | ... | |
|
return ok;
|
||
|
}
|
||
|
|
||
|
bool Database::transaction(QSqlQuery &query) {
|
||
|
this->startTransaction();
|
||
|
query.exec();
|
||
|
this->debugQuery(query);
|
||
|
return this->commitTransaction();
|
||
|
}
|
||
|
|
||
|
bool Database::transaction(QList<QSqlQuery> &queries) {
|
||
|
this->startTransaction();
|
||
|
QSqlQuery q;
|
||
Auch abrufbar als: Unified diff
improvements