Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Public Member Functions | |
QSQLiteResult (const QSQLiteDriver *db) | |
~QSQLiteResult () | |
QVariant | handle () const override |
Returns the low-level database handle for this result set wrapped in a QVariant or an invalid QVariant if there is no handle. | |
QSQLiteResult (const QSQLiteDriver *db) | |
~QSQLiteResult () | |
QVariant | handle () const override |
Returns the low-level database handle for this result set wrapped in a QVariant or an invalid QVariant if there is no handle. | |
Public Member Functions inherited from QSqlResult | |
virtual | ~QSqlResult () |
Destroys the object and frees any allocated resources. | |
Protected Member Functions | |
bool | gotoNext (QSqlCachedResult::ValueCache &row, int idx) override |
bool | reset (const QString &query) override |
Sets the result to use the SQL statement query for subsequent data retrieval. | |
bool | prepare (const QString &query) override |
Prepares the given query for execution; the query will normally use placeholders so that it can be executed repeatedly. | |
bool | execBatch (bool arrayBind) override |
bool | exec () override |
Executes the query, returning true if successful; otherwise returns false. | |
int | size () override |
Returns the size of the SELECT result, or -1 if it cannot be determined or if the query is not a SELECT statement. | |
int | numRowsAffected () override |
Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or if the query is a SELECT statement. | |
QVariant | lastInsertId () const override |
Returns the object ID of the most recent inserted row if the database supports it. | |
QSqlRecord | record () const override |
Returns the current record if the query is active; otherwise returns an empty QSqlRecord. | |
void | detachFromResultSet () override |
void | virtual_hook (int id, void *data) override |
bool | gotoNext (QSqlCachedResult::ValueCache &row, int idx) override |
bool | reset (const QString &query) override |
Sets the result to use the SQL statement query for subsequent data retrieval. | |
bool | prepare (const QString &query) override |
Prepares the given query for execution; the query will normally use placeholders so that it can be executed repeatedly. | |
bool | execBatch (bool arrayBind) override |
bool | exec () override |
Executes the query, returning true if successful; otherwise returns false. | |
int | size () override |
Returns the size of the SELECT result, or -1 if it cannot be determined or if the query is not a SELECT statement. | |
int | numRowsAffected () override |
Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or if the query is a SELECT statement. | |
QVariant | lastInsertId () const override |
Returns the object ID of the most recent inserted row if the database supports it. | |
QSqlRecord | record () const override |
Returns the current record if the query is active; otherwise returns an empty QSqlRecord. | |
void | detachFromResultSet () override |
void | virtual_hook (int id, void *data) override |
Protected Member Functions inherited from QSqlCachedResult | |
QSqlCachedResult (QSqlCachedResultPrivate &d) | |
void | init (int colCount) |
void | cleanup () |
void | clearValues () |
QVariant | data (int i) override |
Returns the data for field index in the current row as a QVariant. | |
bool | isNull (int i) override |
Returns true if the field at position index in the current row is null; otherwise returns false . | |
bool | fetch (int i) override |
Positions the result to an arbitrary (zero-based) row index. | |
bool | fetchNext () override |
Positions the result to the next available record (row) in the result. | |
bool | fetchPrevious () override |
Positions the result to the previous record (row) in the result. | |
bool | fetchFirst () override |
Positions the result to the first record (row 0) in the result. | |
bool | fetchLast () override |
Positions the result to the last record (last row) in the result. | |
int | colCount () const |
ValueCache & | cache () |
void | setNumericalPrecisionPolicy (QSql::NumericalPrecisionPolicy policy) override |
Protected Member Functions inherited from QSqlResult | |
QSqlResult (const QSqlDriver *db) | |
Creates a QSqlResult using database driver db. | |
QSqlResult (QSqlResultPrivate &dd) | |
int | at () const |
Returns the current (zero-based) row position of the result. | |
QString | lastQuery () const |
Returns the current SQL query text, or an empty string if there isn't one. | |
QSqlError | lastError () const |
Returns the last error associated with the result. | |
bool | isValid () const |
Returns true if the result is positioned on a valid record (that is, the result is not positioned before the first or after the last record); otherwise returns false . | |
bool | isActive () const |
Returns true if the result has records to be retrieved; otherwise returns false . | |
bool | isSelect () const |
Returns true if the current result is from a SELECT statement; otherwise returns false . | |
bool | isForwardOnly () const |
Returns true if you can only scroll forward through the result set; otherwise returns false . | |
const QSqlDriver * | driver () const |
Returns the driver associated with the result. | |
virtual void | setAt (int at) |
This function is provided for derived classes to set the internal (zero-based) row position to index. | |
virtual void | setActive (bool a) |
This function is provided for derived classes to set the internal active state to active. | |
virtual void | setLastError (const QSqlError &e) |
This function is provided for derived classes to set the last error to error. | |
virtual void | setQuery (const QString &query) |
Sets the current query for the result to query. | |
virtual void | setSelect (bool s) |
This function is provided for derived classes to indicate whether or not the current statement is a SQL SELECT statement. | |
virtual void | setForwardOnly (bool forward) |
Sets forward only mode to forward. | |
virtual bool | savePrepare (const QString &sqlquery) |
Prepares the given query, using the underlying database functionality where possible. | |
virtual void | bindValue (int pos, const QVariant &val, QSql::ParamType type) |
Binds the value val of parameter type paramType to position index in the current record (row). | |
virtual void | bindValue (const QString &placeholder, const QVariant &val, QSql::ParamType type) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Binds the value val of parameter type paramType to the placeholder name in the current record (row). | |
void | addBindValue (const QVariant &val, QSql::ParamType type) |
Binds the value val of parameter type paramType to the next available position in the current record (row). | |
QVariant | boundValue (const QString &placeholder) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the value bound by the given placeholder name in the current record (row). | |
QVariant | boundValue (int pos) const |
Returns the value bound at position index in the current record (row). | |
QSql::ParamType | bindValueType (const QString &placeholder) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the parameter type for the value bound with the given placeholder name. | |
QSql::ParamType | bindValueType (int pos) const |
Returns the parameter type for the value bound at position index. | |
int | boundValueCount () const |
Returns the number of bound values in the result. | |
QVariantList & | boundValues (QT6_DECL_NEW_OVERLOAD) |
QVariantList | boundValues (QT6_DECL_NEW_OVERLOAD) const |
QString | executedQuery () const |
Returns the query that was actually executed. | |
QStringList | boundValueNames () const |
Returns the names of all bound values. | |
QString | boundValueName (int pos) const |
Returns the name of the bound value at position index in the current record (row). | |
void | clear () |
Clears the entire result set and releases any associated resources. | |
bool | hasOutValues () const |
Returns true if at least one of the query's bound values is a QSql::Out or a QSql::InOut; otherwise returns false . | |
BindingSyntax | bindingSyntax () const |
Returns the binding syntax used by prepared queries. | |
QSql::NumericalPrecisionPolicy | numericalPrecisionPolicy () const |
void | setPositionalBindingEnabled (bool enable) |
bool | isPositionalBindingEnabled () const |
virtual bool | nextResult () |
void | resetBindCount () |
Resets the number of bind parameters. | |
Friends | |
class | QSQLiteDriver |
Additional Inherited Members | |
Public Types inherited from QSqlCachedResult | |
typedef QList< QVariant > | ValueCache |
Protected Types inherited from QSqlResult | |
enum | BindingSyntax { PositionalBinding , NamedBinding } |
This enum type specifies the different syntaxes for specifying placeholders in prepared queries. More... | |
enum | VirtualHookOperation |
Protected Attributes inherited from QSqlResult | |
QSqlResultPrivate * | d_ptr |
Definition at line 74 of file qsql_sqlite.cpp.
|
explicit |
Definition at line 356 of file qsql_sqlite.cpp.
References QSQLiteResult().
Referenced by QSQLiteResult().
QSQLiteResult::~QSQLiteResult | ( | ) |
Definition at line 363 of file qsql_sqlite.cpp.
References d.
|
explicit |
QSQLiteResult::~QSQLiteResult | ( | ) |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Reimplemented from QSqlCachedResult.
|
overrideprotectedvirtual |
Executes the query, returning true if successful; otherwise returns false.
Reimplemented from QSqlResult.
Definition at line 441 of file qsql_sqlite.cpp.
References d.
Referenced by execBatch(), and reset().
|
overrideprotectedvirtual |
Executes the query, returning true if successful; otherwise returns false.
Reimplemented from QSqlResult.
|
overrideprotectedvirtual |
Executes a prepared query in batch mode if the driver supports it, otherwise emulates a batch execution using bindValue() and exec(). QSqlDriver::hasFeature() can be used to find out whether a driver supports batch execution.
Batch execution can be faster for large amounts of data since it reduces network roundtrips.
For batch executions, bound values have to be provided as lists of variants (QVariantList).
Each list must contain values of the same type. All lists must contain equal amount of values (rows).
NULL values are passed in as typed QVariants, for example {QVariant(QMetaType::fromType<int>())}
for an integer NULL value.
Example:
Here, we insert two rows into a SQL table, with each row containing three values.
Reimplemented from QSqlResult.
Definition at line 418 of file qsql_sqlite.cpp.
|
overrideprotectedvirtual |
Executes a prepared query in batch mode if the driver supports it, otherwise emulates a batch execution using bindValue() and exec(). QSqlDriver::hasFeature() can be used to find out whether a driver supports batch execution.
Batch execution can be faster for large amounts of data since it reduces network roundtrips.
For batch executions, bound values have to be provided as lists of variants (QVariantList).
Each list must contain values of the same type. All lists must contain equal amount of values (rows).
NULL values are passed in as typed QVariants, for example {QVariant(QMetaType::fromType<int>())}
for an integer NULL value.
Example:
Here, we insert two rows into a SQL table, with each row containing three values.
Reimplemented from QSqlResult.
|
overrideprotectedvirtual |
Implements QSqlCachedResult.
Definition at line 582 of file qsql_sqlite.cpp.
|
overrideprotectedvirtual |
Implements QSqlCachedResult.
|
overridevirtual |
Returns the low-level database handle for this result set wrapped in a QVariant or an invalid QVariant if there is no handle.
The handle returned here is database-dependent, you should query the type name of the variant before accessing it.
This example retrieves the handle for a sqlite result:
This snippet returns the handle for PostgreSQL or MySQL:
Reimplemented from QSqlResult.
Definition at line 625 of file qsql_sqlite.cpp.
|
overridevirtual |
Returns the low-level database handle for this result set wrapped in a QVariant or an invalid QVariant if there is no handle.
The handle returned here is database-dependent, you should query the type name of the variant before accessing it.
This example retrieves the handle for a sqlite result:
This snippet returns the handle for PostgreSQL or MySQL:
Reimplemented from QSqlResult.
|
overrideprotectedvirtual |
Returns the object ID of the most recent inserted row if the database supports it.
An invalid QVariant will be returned if the query did not insert any value or if the database does not report the id back. If more than one row was touched by the insert, the behavior is undefined.
Note that for Oracle databases the row's ROWID will be returned, while for MySQL databases the row's auto-increment field will be returned.
Reimplemented from QSqlResult.
Definition at line 599 of file qsql_sqlite.cpp.
|
overrideprotectedvirtual |
Returns the object ID of the most recent inserted row if the database supports it.
An invalid QVariant will be returned if the query did not insert any value or if the database does not report the id back. If more than one row was touched by the insert, the behavior is undefined.
Note that for Oracle databases the row's ROWID will be returned, while for MySQL databases the row's auto-increment field will be returned.
Reimplemented from QSqlResult.
|
overrideprotectedvirtual |
Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or if the query is a SELECT
statement.
Implements QSqlResult.
Definition at line 593 of file qsql_sqlite.cpp.
|
overrideprotectedvirtual |
Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or if the query is a SELECT
statement.
Implements QSqlResult.
|
overrideprotectedvirtual |
Prepares the given query for execution; the query will normally use placeholders so that it can be executed repeatedly.
Returns true if the query is prepared successfully; otherwise returns false
.
Reimplemented from QSqlResult.
Definition at line 383 of file qsql_sqlite.cpp.
References d.
|
overrideprotectedvirtual |
Prepares the given query for execution; the query will normally use placeholders so that it can be executed repeatedly.
Returns true if the query is prepared successfully; otherwise returns false
.
Reimplemented from QSqlResult.
|
overrideprotectedvirtual |
Returns the current record if the query is active; otherwise returns an empty QSqlRecord.
The default implementation always returns an empty QSqlRecord.
Reimplemented from QSqlResult.
Definition at line 610 of file qsql_sqlite.cpp.
|
overrideprotectedvirtual |
Returns the current record if the query is active; otherwise returns an empty QSqlRecord.
The default implementation always returns an empty QSqlRecord.
Reimplemented from QSqlResult.
|
overrideprotectedvirtual |
Sets the result to use the SQL statement query for subsequent data retrieval.
Derived classes must reimplement this function and apply the query to the database. This function is only called after the result is set to an inactive state and is positioned before the first record of the new result. Derived classes should return true if the query was successful and ready to be used, or false otherwise.
Implements QSqlResult.
Definition at line 376 of file qsql_sqlite.cpp.
References exec().
|
overrideprotectedvirtual |
Sets the result to use the SQL statement query for subsequent data retrieval.
Derived classes must reimplement this function and apply the query to the database. This function is only called after the result is set to an inactive state and is positioned before the first record of the new result. Derived classes should return true if the query was successful and ready to be used, or false otherwise.
Implements QSqlResult.
|
overrideprotectedvirtual |
Returns the size of the SELECT
result, or -1 if it cannot be determined or if the query is not a SELECT
statement.
Implements QSqlResult.
Definition at line 588 of file qsql_sqlite.cpp.
|
overrideprotectedvirtual |
Returns the size of the SELECT
result, or -1 if it cannot be determined or if the query is not a SELECT
statement.
Implements QSqlResult.
Reimplemented from QSqlCachedResult.
Definition at line 371 of file qsql_sqlite.cpp.
Reimplemented from QSqlCachedResult.
|
friend |
Definition at line 77 of file qsql_sqlite.cpp.