python3-driver icon indicating copy to clipboard operation
python3-driver copied to clipboard

[FR]. Ability to get BLOB_ID for blob that has been created / modified by current transaction

Open pavel-zotov opened this issue 1 year ago • 3 comments

This feature is needed to implement test for #8323 A transaction that has inserted or updated data into the blob column must have ability to obtain BlobID that was assigned to it (i.e. when blob has been materialized). This feature will allow to make full-fledged test for above mentioned ticket, but also it might be useful in the future for some other purposes.

pavel-zotov avatar Dec 11 '24 16:12 pavel-zotov

Well, there is no use for BlobID of created blob in driver outside Cursor._pack_input, as it's pure transitional information. I also don't see how this information could be useful to any driver user. As it's definitely not easy to pass such data from deep internals up to user level in some sensible way (it must go along with other BLOB identification in context of the SQL command, otherwise you can't distinguish between multiple BLOBs), I'd like know at least ONE good use case beyond internal QA test for one bug before I'll commit myself to implement this feature request. I really don't want to complicate the code and API, and make insert/update with blobs a bit slower for something that nobody will really use.

pcisar avatar Apr 04 '25 16:04 pcisar

at least ONE good use case beyond internal QA test

One more ticket has appeared where such feature could be used: #8513 (QA test for it was implemented by parsing of ISQL output)

pavel-zotov avatar Apr 14 '25 10:04 pavel-zotov

Well, I was after use case from Firebird application such information would be needed, not more QA tests that want to peek into Firebird internals. If you want this information in tests, then these tests could be written using the OO API directly as the Python driver provides all needed interfaces. You can even access interfaces wrapped in driver objects (Connection, Cursor etc.), see Connection._att for iAttachments or Cursor._stmt._istmt for iStatement.

pcisar avatar Apr 14 '25 15:04 pcisar