Re: [cx-oracle-users] blob streaming, possible improvement
Brought to you by:
atuining
From: Amaury F. d'A. <ama...@gm...> - 2012-08-31 13:47:37
|
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. -- Amaury Forgeot d'Arc |