Banking_System_Server  1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
dbresult.h
Go to the documentation of this file.
1 
8 #ifndef DBRESULT_H
9 #define DBRESULT_H
10 
11 #include <QJsonArray>
12 #include <QJsonObject>
13 
14 namespace DB
15 {
16 
23 class DbResult
24 {
25 public:
31  DbResult();
32 
39  DbResult(const QList<QVariant>& data);
40 
46  bool isEmpty() const;
47 
53  QJsonObject first() const;
54 
60  int size() const;
61 
69  QJsonObject data(int pos) const;
70 
76  QJsonArray data() const;
77 
83  QString toJsonString() const;
84 
85 private:
86  QJsonArray Data_;
87 };
88 
89 } // namespace DB
90 
91 #endif // DBRESULT_H
The DbResult class represents a result set returned from a database query.
Definition: dbresult.h:24
QJsonObject first() const
Retrieves the first item in the result set.
Definition: dbresult.cpp:25
QJsonArray data() const
Gets all the data in the result set.
Definition: dbresult.cpp:44
int size() const
Gets the number of items in the result set.
Definition: dbresult.cpp:30
DbResult()
Default constructor for DbResult.
Definition: dbresult.cpp:8
bool isEmpty() const
Checks if the result set is empty.
Definition: dbresult.cpp:20
QString toJsonString() const
Converts the result set to a JSON string.
Definition: dbresult.cpp:49