![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include "qsql_firebird_helpers_p.h"#include <QtCore/qtimezone.h>#include <firebird/impl/blr.h>#include <algorithm>#include <cstring>#include <limits>#include <iterator>Go to the source code of this file.
Functions | |
| QString | fbErrorString (IMaster *master, IStatus *status) |
| QSqlError | fbError (IMaster *master, IStatus *status, QSqlError::ErrorType typetype) |
| QString | fbErrorLog (const QSqlError &err) |
| void | finishAndClear (Firebird::ThrowStatusWrapper &st, Firebird::ITransaction *&tr, TxnEnd endend) |
| ITransaction * | startDefaultTransaction (IAttachment *att, ThrowStatusWrapper &st, TxnWait wait) |
| QMetaType::Type | blrTypeToQt (unsigned char blrType, bool hasScale) |
| QMetaType::Type | fbTypeToQt (int fbType, int scalescale) |
| static QString | int128SlotToString (const char *slot, int scalescale, IMaster *master, IStatus *status) |
| bool | encodeInt128Slot (const QVariant &valval, int scalescale, char *slot, IMaster *master, IStatus *status, QString &errorText) |
| QVariant | decodeInt128Slot (const char *slot, int scalescale, QSql::NumericalPrecisionPolicy policy, IMaster *master, IStatus *status, QString *overflowText) |
| ISC_DATE | encodeQDate (IUtil *util, const QDate &d) |
| ISC_TIME | encodeQTime (IUtil *util, const QTime &tt) |
| ISC_TIMESTAMP | encodeQDateTime (IUtil *util, const QDateTime &dt) |
| static QByteArray | toFirebirdZoneId (const QTimeZone &zone) |
| static QTimeZone | fromFirebirdZoneId (const QByteArray &idid) |
| ISC_TIMESTAMP_TZ | encodeQDateTimeTz (IStatus *iStatus, IUtil *util, const QDateTime &dt) |
| ISC_TIME_TZ | encodeQTimeTz (IStatus *iStatus, IUtil *util, const QDateTime &dt) |
| QDate | decodeFirebirdDate (IUtil *util, ISC_DATE date) |
| QTime | decodeFirebirdTime (IUtil *util, ISC_TIME time) |
| QDateTime | decodeFirebirdTimestamp (IUtil *util, const ISC_TIMESTAMP &ts) |
| QDateTime | decodeFirebirdTimestampTz (IStatus *iStatus, IUtil *util, const ISC_TIMESTAMP_TZ &tstz) |
| QDateTime | decodeFirebirdTimeTz (IStatus *iStatus, IUtil *util, const ISC_TIME_TZ &ttz) |
| void | encodeTextValue (char *datadata, int fbType, qsizetype lengthlength, const QByteArray &bytes) |
| QMetaType::Type blrTypeToQt | ( | unsigned char | blrType, |
| bool | hasScale ) |
Definition at line 107 of file qsql_firebird_helpers.cpp.
| QDate decodeFirebirdDate | ( | IUtil * | util, |
| ISC_DATE | date ) |
Definition at line 386 of file qsql_firebird_helpers.cpp.
| QTime decodeFirebirdTime | ( | IUtil * | util, |
| ISC_TIME | time ) |
Definition at line 395 of file qsql_firebird_helpers.cpp.
| QDateTime decodeFirebirdTimestamp | ( | IUtil * | util, |
| const ISC_TIMESTAMP & | ts ) |
Definition at line 406 of file qsql_firebird_helpers.cpp.
| QDateTime decodeFirebirdTimestampTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const ISC_TIMESTAMP_TZ & | tstz ) |
Definition at line 416 of file qsql_firebird_helpers.cpp.
| QDateTime decodeFirebirdTimeTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const ISC_TIME_TZ & | ttz ) |
Definition at line 437 of file qsql_firebird_helpers.cpp.
| QVariant decodeInt128Slot | ( | const char * | slot, |
| int | scale, | ||
| QSql::NumericalPrecisionPolicy | policy, | ||
| IMaster * | master, | ||
| IStatus * | status, | ||
| QString * | overflowText ) |
Definition at line 232 of file qsql_firebird_helpers.cpp.
| bool encodeInt128Slot | ( | const QVariant & | val, |
| int | scale, | ||
| char * | slot, | ||
| IMaster * | master, | ||
| IStatus * | status, | ||
| QString & | errorText ) |
Definition at line 187 of file qsql_firebird_helpers.cpp.
| ISC_DATE encodeQDate | ( | IUtil * | util, |
| const QDate & | d ) |
Definition at line 284 of file qsql_firebird_helpers.cpp.
| ISC_TIMESTAMP encodeQDateTime | ( | IUtil * | util, |
| const QDateTime & | dt ) |
Definition at line 310 of file qsql_firebird_helpers.cpp.
| ISC_TIMESTAMP_TZ encodeQDateTimeTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const QDateTime & | dt ) |
Definition at line 345 of file qsql_firebird_helpers.cpp.
| ISC_TIME encodeQTime | ( | IUtil * | util, |
| const QTime & | t ) |
Definition at line 300 of file qsql_firebird_helpers.cpp.
| ISC_TIME_TZ encodeQTimeTz | ( | IStatus * | iStatus, |
| IUtil * | util, | ||
| const QDateTime & | dt ) |
Definition at line 367 of file qsql_firebird_helpers.cpp.
| void encodeTextValue | ( | char * | data, |
| int | fbType, | ||
| qsizetype | length, | ||
| const QByteArray & | bytes ) |
Encode a UTF-8 string into a CHAR/VARCHAR message slot: VARYING gets a 2-byte length prefix, TEXT is space-padded; data beyond the declared length is truncated. Shared by fillInputBuffer and lookupArrayDesc's bind loop so the Firebird text wire format lives in one place.
Definition at line 460 of file qsql_firebird_helpers.cpp.
| QSqlError fbError | ( | IMaster * | master, |
| IStatus * | status, | ||
| QSqlError::ErrorType | type ) |
Convert a Firebird status vector into a QSqlError. type is the context in which the error occurred, supplied by the caller (open() -> ConnectionError, prepare()/exec() -> StatementError, begin/commit/rollback -> TransactionError); QSqlError::ErrorType categorises errors by that context, not by the underlying Firebird cause. The SQLCODE is carried through as the native error code.
Definition at line 43 of file qsql_firebird_helpers.cpp.
Definition at line 53 of file qsql_firebird_helpers.cpp.
| QString fbErrorString | ( | IMaster * | master, |
| IStatus * | status ) |
Definition at line 27 of file qsql_firebird_helpers.cpp.
| QMetaType::Type fbTypeToQt | ( | int | fbType, |
| int | scale ) |
Definition at line 137 of file qsql_firebird_helpers.cpp.
References fbBaseType().
Commit (or roll back) a transaction whose handle must not outlive a failure: on a throw the interface is released and the member cleared before the rethrow, on success commit/rollback already released it, so the member is cleared too. Taking the handle by reference makes "released implies cleared" structural — every finish site shares this discipline instead of repeating it. (The bare-COMMIT path in exec() intentionally does NOT use this: a failed user COMMIT keeps the still-valid handle so it can be retried.)
Definition at line 74 of file qsql_firebird_helpers.cpp.
References Commit.
|
static |
Definition at line 336 of file qsql_firebird_helpers.cpp.
|
static |
Definition at line 176 of file qsql_firebird_helpers.cpp.
| ITransaction * startDefaultTransaction | ( | IAttachment * | att, |
| ThrowStatusWrapper & | st, | ||
| TxnWait | wait ) |
Start a transaction with the driver's default TPB: read-committed, record-version, read-write. wait selects isc_tpb_wait vs isc_tpb_nowait — the only axis on which the auto-started transaction (wait) and the explicit user transaction (nowait) differ.
Definition at line 96 of file qsql_firebird_helpers.cpp.
|
static |
Firebird names fixed-offset zones by their bare displacement ("+05:30"), while Qt uses "UTC+05:30"-style ids for them. Map between the two so offset-tagged QDateTimes bind and read back cleanly.
Definition at line 328 of file qsql_firebird_helpers.cpp.