diff options
author | Robert Szefner <[email protected]> | 2017-11-09 22:57:51 +0100 |
---|---|---|
committer | Robert Szefner <[email protected]> | 2018-01-06 08:24:32 +0000 |
commit | f99d2b21b8fc867f0ed21dcbfa47865ad013db97 (patch) | |
tree | 3bc1c7016e03d260744674a47c3fda423580dc21 /src/sql/kernel/qsqlfield.cpp | |
parent | 3ed91da4997cf793742e5bba2adb3dbec9ecd458 (diff) |
QPSQL: Add support for forward-only queries
With this change, it is possible to significantly reduce memory
consumption of applications that fetch large result sets from databases.
The implementation is based on the new functionality called "single-row
mode" that was introduced in PostgreSQL version 9.2:
https://www.postgresql.org/docs/9.2/static/libpq-async.html
It also uses asynchronous commands PQsendQuery(), PQgetResult():
https://www.postgresql.org/docs/9.2/static/libpq-single-row-mode.html
[ChangeLog][QtSql][QPSQL] Added support for forward-only queries (requires
libpq version 9.2 or later)
[Important Behavior Changes] The QPSQL driver now supports forward-only
queries. To use this feature, you must build QPSQL plugin with PostreSQL
client library version 9.2 or later. See the Qt SQL documentation for
more information about QPSQL limitations of forward-only queries
(sql-driver.html).
[Important Behavior Changes] If you build the QPSQL plugin with PostgreSQL
version 9.2 or later, then you must distribute your application with
libpq version 9.2 or later. Otherwise, the QPSQL plugin will fail to load.
Task-number: QTBUG-63714
Change-Id: I15db8c8fd664f2a1f719329f5d113511fa69010c
Reviewed-by: Andy Shaw <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
Diffstat (limited to 'src/sql/kernel/qsqlfield.cpp')
-rw-r--r-- | src/sql/kernel/qsqlfield.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index a258d44df76..782ab0d71cb 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -588,7 +588,6 @@ void QSqlField::setAutoValue(bool autoVal) \sa tableName() */ - void QSqlField::setTableName(const QString &table) { detach(); @@ -598,9 +597,12 @@ void QSqlField::setTableName(const QString &table) /*! Returns the tableName of the field. + \note When using the QPSQL driver, due to limitations in the libpq library, + the \c tableName() field is not populated in a QSqlField resulting + from a QSqlRecord obtained by QSqlQuery::record() of a forward-only query. + \sa setTableName() */ - QString QSqlField::tableName() const { return d->table; |