summaryrefslogtreecommitdiffstats
path: root/src/sql/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/doc/src')
-rw-r--r--src/sql/doc/src/sql-driver.qdoc63
1 files changed, 62 insertions, 1 deletions
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index c8de78dd79..fd95e89812 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -299,6 +299,12 @@
e.g., the SQLSTATEs. Before setting this connect option, consult
your ODBC documentation about behavior differences you can expect.
+ When using the SAP HANA database, the connection has to be
+ established using the option "SCROLLABLERESULT=TRUE", as the
+ HANA ODBC driver does not provide scrollable results by default, e.g.:
+
+ \snippet code/doc_src_sql-driver.cpp 39
+
If you experience very slow access of the ODBC datasource, make sure
that ODBC call tracing is turned off in the ODBC datasource manager.
@@ -380,6 +386,45 @@
Binary Large Objects are supported through the \c BYTEA field type in
PostgreSQL server versions >= 7.1.
+ \section3 QPSQL Forward-only query support
+
+ To use forward-only queries, you must build the QPSQL plugin with
+ PostreSQL client library version 9.2 or later. If the plugin is
+ built with an older version, then forward-only mode will not be
+ available - calling QSqlQuery::setForwardOnly() with \c true will
+ have no effect.
+
+ \warning 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, loading the QPSQL plugin will fail with the following message:
+
+ \snippet code/doc_src_sql-driver.qdoc 35
+
+ While navigating the results in forward-only mode, the handle of
+ QSqlResult may change. Applications that use the low-level handle of
+ SQL result must get a new handle after each call to any of QSqlResult
+ fetch functions. Example:
+
+ \snippet code/doc_src_sql-driver.cpp 36
+
+ While reading the results of a forward-only query with PostgreSQL,
+ the database connection cannot be used to execute other queries.
+ This is a limitation of libpq library. Example:
+
+ \snippet code/doc_src_sql-driver.cpp 37
+
+ This problem will not occur if query1 and query2 use different
+ database connections, or if we execute query2 after the while loop.
+
+ \note Some methods of QSqlDatabase like tables(), primaryIndex()
+ implicity execute SQL queries, so these also cannot be used while
+ navigating the results of forward-only query.
+
+ \note QPSQL will print the following warning if it detects a loss of
+ query results:
+
+ \snippet code/doc_src_sql-driver.qdoc 38
+
\section3 How to Build the QPSQL Plugin on Unix and \macos
You need the PostgreSQL client library and headers installed.
@@ -404,7 +449,7 @@
\target QTDS
\section2 QTDS for Sybase Adaptive Server
- \note TDS is no longer used by MS Sql Server, and is superceded by
+ \note TDS is no longer used by MS Sql Server, and is superseded by
\l{QODBC}{ODBC}. QTDS is obsolete from Qt 4.7.
It is not possible to set the port with QSqlDatabase::setPort() due to limitations in the
@@ -534,6 +579,22 @@
\snippet code/doc_src_sql-driver.qdoc 23
+ \section3 Enable REGEXP operator
+
+ SQLite comes with a REGEXP operation. However the needed implementation must
+ be provided by the user. For convenience a default implementation can be
+ enabled by \l{QSqlDatabase::setConnectOptions()} {setting the connect
+ option} \c{QSQLITE_ENABLE_REGEXP} before \l{QSqlDatabase::open()} {the
+ database connection is opened}. Then a SQL statement like "column REGEXP
+ 'pattern'" basically expands to the Qt code
+
+ \snippet code/doc_src_sql-driver.cpp 34
+
+ For better performance the regular expressions are cached internally. By
+ default the cache size is 25, but it can be changed through the option's
+ value. For example passing "\c{QSQLITE_ENABLE_REGEXP=10}" reduces the
+ cache size to 10.
+
\section3 QSQLITE File Format Compatibility
SQLite minor releases sometimes break file format forward compatibility.