MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / queryToMapObject

Method queryToMapObject

Cutelyst/Plugins/Utils/Sql/sql.cpp:53–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53QVariantMap Sql::queryToMapObject(QSqlQuery &query)
54{
55 QVariantMap ret;
56 if (query.next()) {
57 const QSqlRecord record = query.record();
58 const int columns = record.count();
59 for (int i = 0; i < columns; ++i) {
60 ret.insert(record.fieldName(i), query.value(i));
61 }
62 }
63 return ret;
64}
65
66QJsonObject Sql::queryToJsonObject(QSqlQuery &query)
67{

Callers

nothing calls this directly

Calls 2

insertMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected