QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
The QueryResult class represents the result of a query executed by execSql() More...
#include <qgsabstractdatabaseproviderconnection.h>
Public Member Functions | |
QStringList | columns () const |
Returns the column names. More... | |
qlonglong | fetchedRowCount () const |
Returns the number of fetched rows. More... | |
bool | hasNextRow () const |
Returns true if there are more rows to fetch. More... | |
QList< QVariant > | nextRow () const |
Returns the next result row or an empty row if there are no rows left. More... | |
QList< QList< QVariant > > | rows (QgsFeedback *feedback=nullptr) |
Returns the result rows by calling the iterator internally and fetching all the rows, an optional feedback can be used to interrupt the fetching loop. More... | |
The QueryResult class represents the result of a query executed by execSql()
It encapsulates an iterator over the result rows and a list of the column names.
Rows can be retrieved by iterating over the result with hasNextRow() and nextRow() or by calling rows() that will internally iterate over the results and return the whole result list.
Definition at line 82 of file qgsabstractdatabaseproviderconnection.h.
QStringList QgsAbstractDatabaseProviderConnection::QueryResult::columns | ( | ) | const |
Returns the column names.
qlonglong QgsAbstractDatabaseProviderConnection::QueryResult::fetchedRowCount | ( | ) | const |
Returns the number of fetched rows.
bool QgsAbstractDatabaseProviderConnection::QueryResult::hasNextRow | ( | ) | const |
Returns true
if there are more rows to fetch.
QList<QVariant> QgsAbstractDatabaseProviderConnection::QueryResult::nextRow | ( | ) | const |
Returns the next result row or an empty row if there are no rows left.
QList<QList<QVariant> > QgsAbstractDatabaseProviderConnection::QueryResult::rows | ( | QgsFeedback * | feedback = nullptr | ) |
Returns the result rows by calling the iterator internally and fetching all the rows, an optional feedback can be used to interrupt the fetching loop.