The SqlQuery class was created to facilitate integration with SqlDataBaseStorage and manipulation to the database through JSON.
More...
#include <sqlquery.h>
|
| | SqlQuery (SqlDatabaseStorage &dbStorage) |
| | Constructs a QSqlQuery object using the database dbStorage. More...
|
| |
| QJsonObject | exec () |
| | Executes and returns a JSON indicating success, or failure through the key success. More...
|
| |
| QJsonObject | exec (const QString &query) |
| | Executes a query and returns a JSON indicating success, or failure through the key "success" and "message". More...
|
| |
| QJsonArray | toJson () |
| | Returns the result of a select converted to a QJsonArray. If there is a failure, a JSON object with two fields will be returned: "success" and "message". If there are no results, QJsonArray will return a empty object. More...
|
| |
| QJsonObject | deleteRecord (const QString &table, const QString &condition) |
| | Delete a record given a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message". More...
|
| |
| QJsonObject | insertFromJson (const QJsonObject &json, const QString &table) |
| | Insert a record given a json and a table. Returns a JSON indicating success, or failure through the key "success" and "message". More...
|
| |
| QJsonObject | updateFromJson (const QJsonObject &json, const QString &table, const QString &condition) |
| | Update a record given a json, a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message". More...
|
| |
The SqlQuery class was created to facilitate integration with SqlDataBaseStorage and manipulation to the database through JSON.
◆ SqlQuery()
Constructs a QSqlQuery object using the database dbStorage.
- Parameters
-
◆ deleteRecord()
| QJsonObject SqlQuery::deleteRecord |
( |
const QString & |
table, |
|
|
const QString & |
condition |
|
) |
| |
Delete a record given a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message".
- Parameters
-
- Returns
- QJsonObject
◆ exec() [1/2]
| QJsonObject SqlQuery::exec |
( |
| ) |
|
Executes and returns a JSON indicating success, or failure through the key success.
- Returns
- QJsonObject
◆ exec() [2/2]
| QJsonObject SqlQuery::exec |
( |
const QString & |
query | ) |
|
Executes a query and returns a JSON indicating success, or failure through the key "success" and "message".
- Returns
- QJsonObject
◆ insertFromJson()
| QJsonObject SqlQuery::insertFromJson |
( |
const QJsonObject & |
json, |
|
|
const QString & |
table |
|
) |
| |
Insert a record given a json and a table. Returns a JSON indicating success, or failure through the key "success" and "message".
- Parameters
-
- Returns
- QJsonObject
◆ toJson()
| QJsonArray SqlQuery::toJson |
( |
| ) |
|
Returns the result of a select converted to a QJsonArray. If there is a failure, a JSON object with two fields will be returned: "success" and "message". If there are no results, QJsonArray will return a empty object.
- Returns
- QJsonArray
◆ updateFromJson()
| QJsonObject SqlQuery::updateFromJson |
( |
const QJsonObject & |
json, |
|
|
const QString & |
table, |
|
|
const QString & |
condition |
|
) |
| |
Update a record given a json, a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message".
- Parameters
-
- Returns
- QJsonObject
The documentation for this class was generated from the following files:
- /home/herik/CPPWebFramework/CPPWebFramework/cwf/sqlquery.h
- /home/herik/CPPWebFramework/CPPWebFramework/cwf/sqlquery.cpp