[DB-SIG] About LOB

Kwon, Chan Young chan.young.kwon at sap.com
Thu Apr 28 04:14:45 CEST 2011


Hi, 

Let me describe more...
1. My suggestion of LOB object is kind of Locator object. It does not contain whole massive data. It just passes small piece of data when its methods are called.
2. buffer object is not enough to handle various kinds of LOB types. For example, character LOB, binary LOB and unicode character LOB.

In my company, this LOB class is already used as extension of DBAPI spec 2.0.
All colleagues like LOB class because it is very simple and easy to use.
So I sent this for your information.


Best wishes,
Chanyoung Kwon

SAP R&D Center Korea



-----Original Message-----
From: Chris Clark [mailto:Chris.Clark at ingres.com] 
Sent: Thursday, April 28, 2011 2:05 AM
To: Kwon, Chan Young
Cc: db-sig at python.org
Subject: Re: [DB-SIG] About LOB

Kwon, Chan Young wrote:
> I am implementing new DB API for new Database according to DB API 2.0. (as C-Extension)
> There is no specification about LOB in DB API 2.0
> Especially, I need LOB object for piecewise LOB writing/reading after query execution.
> So I defined my own LOB object.
> I tried to make simple and easy interface for LOB.
>   


BLarge OBject's (BLOBs) are alluded to in pep 249 BUT they really are
not detailed so I think you have spotted a weakness in the spec. CLOBs
(Character Large OBjects) are not covered at all. Locators are not
discussed but implied by references to bufferobjects.

For BLOBs as input bind parameters check out the Binary() constructor
(case sensitive) at http://www.python.org/dev/peps/pep-0249/.
For BLOB results look for bufferobject in
http://www.python.org/dev/peps/pep-0249/

The spec (as I read it) really expects LOBs to be handled as one massive
block. However implementators can choose to implement locators behind
the scene so that data isn't sent across the wire unless the buffer
object is read from.

So, model your LOB access methods on bufferobjects and you should be all
set! Marc-Andre reads/responds to the list regularly so take note of any
suggestions he has :-)

Hope that helps get you started.

Chris



More information about the DB-SIG mailing list