4#ifndef QSQLNULLDRIVER_P_H
5#define QSQLNULLDRIVER_P_H
18#include <QtSql/private/qtsqlglobal_p.h>
19#include "QtCore/qvariant.h"
20#include "QtSql/qsqldriver.h"
21#include "QtSql/qsqlerror.h"
22#include "QtSql/qsqlresult.h"
35 inline bool fetch(
int)
override {
return false; }
38 inline bool isNull(
int)
override {
return false; }
39 inline int size()
override {
return -1; }
42 inline void setAt(
int)
override {}
49 inline bool exec()
override {
return false; }
The QSqlDriver class is an abstract base class for accessing specific SQL databases.
DriverFeature
This enum contains a list of features a driver might support.
virtual void setLastError(const QSqlError &e)
This function is used to set the value of the last error, error, that occurred on the database.
The QSqlError class provides SQL database error information.
bool open(const QString &, const QString &, const QString &, const QString &, int, const QString &) override
Derived classes must reimplement this pure virtual function to open a database connection on database...
QSqlResult * createResult() const override
Creates an empty SQL result on the database.
void setOpenError(bool) override
This function sets the open error state of the database to error.
void close() override
Derived classes must reimplement this pure virtual function in order to close the database connection...
void setOpen(bool) override
This function sets the open state of the database to open.
void setLastError(const QSqlError &) override
This function is used to set the value of the last error, error, that occurred on the database.
bool hasFeature(DriverFeature) const override
Returns true if the driver supports feature feature; otherwise returns false.
bool exec() override
Executes the query, returning true if successful; otherwise returns false.
bool savePrepare(const QString &) override
Prepares the given query, using the underlying database functionality where possible.
bool prepare(const QString &) override
Prepares the given query for execution; the query will normally use placeholders so that it can be ex...
void bindValue(int, const QVariant &, QSql::ParamType) override
Binds the value val of parameter type paramType to position index in the current record (row).
bool fetchLast() override
Positions the result to the last record (last row) in the result.
QSqlNullResult(const QSqlDriver *d)
void setLastError(const QSqlError &) override
This function is provided for derived classes to set the last error to error.
bool reset(const QString &) override
Sets the result to use the SQL statement query for subsequent data retrieval.
bool fetchFirst() override
Positions the result to the first record (row 0) in the result.
void setForwardOnly(bool) override
Sets forward only mode to forward.
int size() override
Returns the size of the SELECT result, or -1 if it cannot be determined or if the query is not a SELE...
bool isNull(int) override
Returns true if the field at position index in the current row is null; otherwise returns false.
void setSelect(bool) override
This function is provided for derived classes to indicate whether or not the current statement is a S...
void setAt(int) override
This function is provided for derived classes to set the internal (zero-based) row position to index.
void setQuery(const QString &) override
Sets the current query for the result to query.
int numRowsAffected() override
Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or i...
bool fetch(int) override
Positions the result to an arbitrary (zero-based) row index.
void setActive(bool) override
This function is provided for derived classes to set the internal active state to active.
void bindValue(const QString &, const QVariant &, QSql::ParamType) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
QVariant data(int) override
Returns the data for field index in the current row as a QVariant.
The QSqlResult class provides an abstract interface for accessing data from specific SQL databases.
virtual void setLastError(const QSqlError &e)
This function is provided for derived classes to set the last error to error.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.