![]() |
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_result_p.h>
Public Types | |
| using | BlobWriter = std::function<bool(ISC_QUAD &, const QByteArray &)> |
| Public Types inherited from QSqlResultPrivate | |
| using | IndexMap = QHash<QString, QList<int>> |
| using | QHolderVector = QList<QHolder> |
Public Member Functions | |
| ~QFirebirdResultPrivate () | |
| void | cleanup () |
| void | closeCursor () |
| Firebird::IMaster * | master () const |
| Firebird::IStatus * | status () const |
| Firebird::IAttachment * | att () const |
| Firebird::ITransaction * | activeTransaction () const |
| Firebird::ITransaction * | ensureTransaction () |
| bool | buildInputMessage (QString &errorText) |
| bool | fillInputBuffer (const QList< QVariant > &vals, QString &errorText, BlobWriter blobWriter={}) |
| bool | encodeScaledNumeric (char *data, int fbType, int scale, const QVariant &val, QString &errorText) |
| void | writeInlineBlob (ISC_QUAD &blobId, const QByteArray &blobData) |
| void | adoptReplacementTransaction (Firebird::ITransaction *executedTr, Firebird::ITransaction *newTr) |
| bool | ensureCachedRow (int index) |
| QString | formatFbError (const QString &ctx) |
| QSqlResultPrivate (QSqlResult *q, const QSqlDriver *drv) | |
| Public Member Functions inherited from QSqlResultPrivate | |
| QSqlResultPrivate (QSqlResult *q, const QSqlDriver *drv) | |
| virtual | ~QSqlResultPrivate ()=default |
| void | clearValues () |
| void | resetBindCount () |
| void | clearIndex () |
| void | clear () |
| virtual QString | fieldSerial (qsizetype) const |
| QString | positionalToNamedBinding (const QString &query) const |
| QString | namedToPositionalBinding (const QString &query) |
| QString | holderAt (int index) const |
Static Public Attributes | |
| static constexpr int | AffectedPending = -2 |
Additional Inherited Members | |
| Static Public Member Functions inherited from QSqlResultPrivate | |
| static bool | isVariantNull (const QVariant &variant) |
Definition at line 109 of file qsql_firebird_result_p.h.
| using QFirebirdResultPrivate::BlobWriter = std::function<bool(ISC_QUAD &, const QByteArray &)> |
Core helper: fill inBuffer from a flat list of values (one per parameter, metadata taken from the inCols cache). blobWriter, when set, is called for SQL_BLOB parameters instead of using att->createBlob(). Signature: bool(ISC_QUAD &blobId, const QByteArray &data). Returns false on error.
Definition at line 167 of file qsql_firebird_result_p.h.
|
inline |
Definition at line 116 of file qsql_firebird_result_p.h.
References cleanup(), and driverAlive.
|
inline |
Definition at line 151 of file qsql_firebird_result_p.h.
| void QFirebirdResultPrivate::adoptReplacementTransaction | ( | Firebird::ITransaction * | executedTr, |
| Firebird::ITransaction * | newTr ) |
Adopt a transaction handle that IStatement::execute() returned in place of the one it was given, releasing the replaced handle exactly once.
Definition at line 430 of file qsql_firebird_result.cpp.
|
inline |
Definition at line 150 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::buildInputMessage | ( | QString & | errorText | ) |
Definition at line 322 of file qsql_firebird_result.cpp.
| void QFirebirdResultPrivate::cleanup | ( | ) |
Definition at line 83 of file qsql_firebird_result.cpp.
References affectedRows, cacheComplete, isProcExec, isSelect, procRowFetched, recordCached, txnOp, and useRowCache.
Referenced by ~QFirebirdResultPrivate().
| void QFirebirdResultPrivate::closeCursor | ( | ) |
Close the open cursor (if any), releasing the handle if the close throws. Assumes the attachment is alive — only exec()/execBatch() call it, and only while executing. cleanup() handles the detached case inline.
Definition at line 144 of file qsql_firebird_result.cpp.
| bool QFirebirdResultPrivate::encodeScaledNumeric | ( | char * | data, |
| int | fbType, | ||
| int | scale, | ||
| const QVariant & | val, | ||
| QString & | errorText ) |
Per-value encoders, factored out of fillInputBuffer so it stays focused on parameter iteration and NULL handling. Both may throw FbException, which exec()/execBatch translate into a QSqlError. encodeScaledNumeric returns false (with errorText set) for values that cannot be represented exactly in the column's range.
Definition at line 330 of file qsql_firebird_result.cpp.
References fbBaseType().
| bool QFirebirdResultPrivate::ensureCachedRow | ( | int | index | ) |
Pull rows from the server cursor (sequential fetchNext, which benefits from fbclient read-ahead) into rowCache until it holds at least index+1 rows or the cursor is exhausted. Returns true if rowCache[index] exists. May throw FbException (callers wrap in try/catch as elsewhere).
Definition at line 157 of file qsql_firebird_result.cpp.
References cacheComplete.
| ITransaction * QFirebirdResultPrivate::ensureTransaction | ( | ) |
Definition at line 181 of file qsql_firebird_result.cpp.
| bool QFirebirdResultPrivate::fillInputBuffer | ( | const QList< QVariant > & | vals, |
| QString & | errorText, | ||
| BlobWriter | blobWriter = {} ) |
Definition at line 449 of file qsql_firebird_result.cpp.
References fbBaseType(), ColumnInfo::fbType, ColumnInfo::length, and ColumnInfo::scale.
Definition at line 174 of file qsql_firebird_result.cpp.
|
inline |
Returns the driver's master/status/attachment/transaction without copying them. These are const accessors that hand back mutable Firebird interface pointers by design: the Firebird OO API has no const-qualified interfaces, and result fetching (e.g. data() const reading a BLOB) is inherently a mutating server operation, so logical const cannot propagate here.
Definition at line 148 of file qsql_firebird_result_p.h.
|
inline |
Definition at line 46 of file qsqlresult_p.h.
|
inline |
Definition at line 149 of file qsql_firebird_result_p.h.
| void QFirebirdResultPrivate::writeInlineBlob | ( | ISC_QUAD & | blobId, |
| const QByteArray & | blobData ) |
Definition at line 408 of file qsql_firebird_result.cpp.
|
staticconstexpr |
getAffectedRecords() costs a statement-info round trip, so exec() only marks the count as pending and numRowsAffected() resolves it on demand (QIBASE defers the same way). -1 = unknown/none.
Definition at line 215 of file qsql_firebird_result_p.h.
| int QFirebirdResultPrivate::affectedRows = -1 |
Definition at line 216 of file qsql_firebird_result_p.h.
Referenced by cleanup().
|
mutable |
Array descriptors resolved by cachedArrayDesc, keyed by relation/field. Valid while the statement lives; cleared in cleanup(). mutable: data() reads through a const private pointer and only populates the cache.
Definition at line 208 of file qsql_firebird_result_p.h.
| Firebird::ITransaction* QFirebirdResultPrivate::autoTrans = nullptr |
Definition at line 191 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::cacheComplete = false |
Definition at line 231 of file qsql_firebird_result_p.h.
Referenced by cleanup(), and ensureCachedRow().
|
mutable |
QSqlRecord is derived solely from the (immutable-after-prepare) column metadata, so build it once and hand back copies — see record().
Definition at line 246 of file qsql_firebird_result_p.h.
| QList<ColumnInfo> QFirebirdResultPrivate::cols |
Definition at line 196 of file qsql_firebird_result_p.h.
| Firebird::IResultSet* QFirebirdResultPrivate::cursor = nullptr |
Definition at line 190 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::driverAlive = true |
Set to false by ~QFirebirdDriver if the driver object is destroyed while this result is still alive. Once false, cleanup() must not dereference the (now-freed) driver private.
Definition at line 139 of file qsql_firebird_result_p.h.
Referenced by ~QFirebirdResultPrivate().
| QByteArray QFirebirdResultPrivate::inBuffer |
Definition at line 201 of file qsql_firebird_result_p.h.
| QList<ColumnInfo> QFirebirdResultPrivate::inCols |
Definition at line 197 of file qsql_firebird_result_p.h.
| Firebird::IMessageMetadata* QFirebirdResultPrivate::inMeta = nullptr |
Definition at line 194 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::isProcExec = false |
Definition at line 218 of file qsql_firebird_result_p.h.
Referenced by cleanup().
| bool QFirebirdResultPrivate::isSelect = false |
Definition at line 217 of file qsql_firebird_result_p.h.
Referenced by cleanup().
| QByteArray QFirebirdResultPrivate::outBuffer |
Definition at line 200 of file qsql_firebird_result_p.h.
| Firebird::IMessageMetadata* QFirebirdResultPrivate::outMeta = nullptr |
Definition at line 193 of file qsql_firebird_result_p.h.
| bool QFirebirdResultPrivate::procRowFetched = false |
Definition at line 219 of file qsql_firebird_result_p.h.
Referenced by cleanup().
|
mutable |
Definition at line 247 of file qsql_firebird_result_p.h.
Referenced by cleanup().
| QList<QByteArray> QFirebirdResultPrivate::rowCache |
Definition at line 232 of file qsql_firebird_result_p.h.
| Firebird::IStatement* QFirebirdResultPrivate::stmt = nullptr |
Definition at line 189 of file qsql_firebird_result_p.h.
| TxnOp QFirebirdResultPrivate::txnOp = TxnOp::None |
Definition at line 221 of file qsql_firebird_result_p.h.
Referenced by cleanup().
| bool QFirebirdResultPrivate::useRowCache = false |
-— Opt-in client-side row cache (FB_SCROLLABLE_CACHE) -— Enabled in exec() for scrollable SELECTs when the driver flag is set. rowCache holds a raw snapshot of outBuffer per absolute row index; on a cached fetch the snapshot is copied back into outBuffer so data() works unchanged (BLOB/array columns cache their blob id, valid for the txn).
Definition at line 230 of file qsql_firebird_result_p.h.
Referenced by cleanup().