SQL/Doc: add notes about QDateTime handling

Add a note on how timestamps are handled for the different database
drivers.

Task-number: QTBUG-130118
Change-Id: I1bad480fa18b5b719870635db1444c8db8c7d966
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d63f14473345cdb83c2da00a19892f57e661a5d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2024-11-05 19:14:33 +01:00 committed by Qt Cherry-pick Bot
parent 2b3e56e2b4
commit 0f80bb1811

View File

@ -122,6 +122,13 @@
library binary parity and exact matching with MySQL APIs and commands.
Therefore the plugin for MySQL and MariaDB are combined into one Qt plugin.
\section3 Timestamp Support
Since Qt 6.8, QDateTime values are converted to UTC before insertion and
back from UTC during retrieval. To make this work, the driver sets
the connection time zone to UTC during open() (SET time_zone = '+00:00').
Since MySQL does not store any timezone information, this information is
lost and all retrieved QDateTime values are UTC.
\section3 QMYSQL Stored Procedure Support
MySQL has stored procedure support at the SQL level, but no
@ -444,6 +451,12 @@
Some drivers do not support scrollable cursors. In that case, only
queries in \l QSqlQuery::setForwardOnly() mode can be used successfully.
\section3 Timestamp Support
ODBC is using TIMESTAMP_STRUCT which has no information about any
timezone or similar. Due to this, the QDateTime is used without honoring
the timezone at all.
\note: This might change in the future.
\section3 ODBC Stored Procedure Support
With Microsoft SQL Server the result set returned by a stored
@ -542,6 +555,14 @@
For more information about PostgreSQL visit \l http://www.postgresql.org.
\section3 Timestamp Support
Since Qt 6.8, QDateTime values are converted to UTC before insertion
and back from UTC during retrieval. To make this work, the driver sets
the connection time zone to UTC during open() (SET TIME ZONE 'UTC').
Although PostgreSQL has the `timestamptz` column type, the timezone
used during insertion is not preserved and therefore all retrieved
QDateTime values are UTC.
\section3 QPSQL Unicode Support
The QPSQL driver automatically detects whether the PostgreSQL
@ -716,6 +737,12 @@
You can find information about SQLite on \l{http://www.sqlite.org}.
\section3 Timestamp Support
SQLite does not have a special timestamp column type. A QDateTime is
stored as string, formatted in Qt::ISODateWithMs and therefore the
QDateTime timezone information is preserved during insertion and
select.
\section3 Connection options
The Qt SQLite plugin honors the following connection options:
\table
@ -836,6 +863,12 @@
National Character Varying (NVARCHAR), or National Character Large Object (NCLOB) must be used.
For more information about Mimer SQL and unicode, see \l{https://developer.mimer.com/features/multilingual-support}
\section3 Timestamp Support
MimerSQL does not know anything about timezones and QDateTime
is used without honoring the timezone at all.
\note: This might change in the future.
\section3 QMIMER Stored Procedure Support
Mimer SQL have stored procedures according to the SQL standard (PSM) and
@ -877,6 +910,16 @@
database file, no matter whether it is stored locally or on another
server.
\section3 Timestamp Support
Interbase stores timestamps in UTC without any timezone information.
Due to this, the QDateTime is used without honoring the timezone at all.
Since Firebird 4.0, the database supports timestamps with timezones. The
timezone information is stored separately to the timestamp so it can
be properly retrieved later on. See the Firebird
\l {https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref40/fblangref40-datatypes-datetime.html}
{documentation} for more information about timestamp handling.
\section3 Connection options
The Qt Borland InterBase plugin honors the following connection options:
\table