On Dec 18, 2007, at 4:30 AM, Chris Withers wrote:

>
> Hi All,
>
> I guess this question would also be applicable to the lists of the rdb
> in question but since SA is going to have to help to I thought I'd ask
> here...
>
> Okay, so if I have a table that contains a blob-ish field containing
> something like a 20Mb PDF per row (I'm not sure this is a good idea,  
> and
> I'm welcome to other suggestions ;-)) I'd like to be able to return
> chunks of that PDF in http range requests (Adobe's pluggin is good at
> them...)
>
> How do I get SA and the RDB to only return a portion of the data in  
> the
> field? Is that even possible? What sort of strategies do people have  
> in
> this situation?
>

cx_oracle's blob object is able to stream out blobs like filehandles,  
since thats how OCI wants it to be done.  Im not sure if it only  
allows sequential access or access to any range.  As far as other  
DBAPIs like psycopg2 and MySQLDB, you'd have to dig into the docs/ 
mailing lists/source code of those to see what resources are  
available.  Another way might be some SQL function available within  
the database that truncates the binary stream to a certain portion of  
itself before selecting, but Im not aware of any function which does  
that (havent checked tho).

Current SA behavior is to abstract away the "streamingness" of  
cx_oracles binary objects, but theres no reason we couldnt expose this  
functionality through something like a StreamingBinary type or similar.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to