Re: [cx-oracle-users] blob streaming, possible improvement
Brought to you by:
atuining
From: Walter D. <wa...@li...> - 2012-09-03 10:09:18
|
On 31.08.12 15:47, Amaury Forgeot d'Arc wrote: > Hi, > > 2012/8/31 Joram Agten <jor...@gm...>: >> I had to upload 20GB of documents from an ftp site, to a table with a BLOB >> column. In order to do this in a streaming fashion I had to write a little helper >> class for the BLOB stream. > > This is a good idea! > >> def write(self, data, offset=None): > But this "offset" is not standard for file-like objects. > > In this case I'd suggest your class to inherit from io.RawIOBase, > and follow its interface. > > Here you'd simply have to implement write(), override writable() to return True, > and implement seek() and tell() just by keeping an internal ._offset member. When we get a file-like object for writing to a [BC]LOG, can we have one for reading too? Servus, Walter |