EasyQtSql
Easy SQL data access helper for QtSql
|
QSqlQuery wrapper for UPDATE ... SET ... WHERE ... query execution. More...
#include <EasyQtSql.h>
Public Member Functions | |
UpdateQuery (const QString &table, const QSqlDatabase &db) | |
UpdateQuery & | set (const QString &field, const QVariant &value) |
Sets table field to value More... | |
UpdateQuery & | set (const QVariantMap &map) |
Sets table fields to values from map More... | |
NonQueryResult | where (const QString &expr) |
Executes update query with expr condition. More... | |
NonQueryResult | where (const QString &expr, const QVariant &last) |
Executes update query with expr condition and last parameter binding. More... | |
template<typename... Rest> | |
NonQueryResult | where (const QString &expr, const QVariant &first, const Rest &... rest) |
NonQueryResult | exec () |
Executes UPDATE query without conditions. More... | |
QSqlQuery wrapper for UPDATE ... SET ... WHERE ... query execution.
|
inline |
|
inline |
Executes UPDATE query without conditions.
|
inline |
Sets table field to value
field | Table field name |
value | Value to set |
The method returns an UpdateQuery reference so its call can be chained:
|
inline |
Sets table fields to values from map
map | Values map. Map key is field name, map value is field value. |
The method returns an UpdateQuery reference so its calls can be chained.
|
inline |
|
inline |
Executes update query with expr condition and last parameter binding.
expr | WHERE condition |
last | Parameter to bind on WHERE expression |
The method supports variable count of QVariant parameters. Parameters are bound with QSqlQuery::addBindValue.
|
inline |