# LogDoctor: QueryWrapper Class Reference

Loading...
Searching...
No Matches
QueryWrapper Class Referencefinal

QueryWrapper. More...

`#include <database.h>`

## Public Member Functions

QSqlQuery * | operator-> () noexcept
| Returns a pointer to the underlying QSqlQuery instance.
void | operator<< (const char *text) noexcept
| Appends the given text to the internal statement.
void | operator<< (const QString &text) noexcept
| Appends the given text to the internal statement.
void | operator() ()
| Executes the query using the internal statement.
void | operator() (const QString &text)
| Executes the query using the given statement.
QVariant | operator[] (const int idx) const noexcept
| Returns the query value at the given index of the current record.
size_t | size ()
| Returns the number of records in the query result.
const QString & | dbName () const noexcept
| Returns the name of the associated database.

## Detailed Description

QueryWrapper.

A wrapper around a QSqlQuery, associated with a database

## Member Function Documentation

## operator()() [1/2]

void QueryWrapper::operator() | ( |  | ) |

inline

Executes the query using the internal statement.

Throws in case of failure

Exceptions

  VoidException |

## operator()() [2/2]

void QueryWrapper::operator() | ( | const QString & | text | ) |

Executes the query using the given statement.

Throws in case of failure

Exceptions

  VoidException |

## size()

size_t QueryWrapper::size | ( |  | ) |

Returns the number of records in the query result.

Throws if the query cannot be restored at the initial position

Exceptions

  DatabaseException |

The documentation for this class was generated from the following files:

- logdoctor/modules/database/database.h
- logdoctor/modules/database/database.cpp