On Sep 25, 2008, at 4:12 PM, MHC wrote:
> > Michael, > > I installed 0.5.0rc1 and the patch. It works great -- I can set > auto_convert_lobs to False and call the getfilename, fileexists, and > size methods on the bfile columns, and I can set it to True and get > the default behavior. Thanks very much. > > A couple of questions... Can I change this setting on the fly if I > want to vary the behavior, or does it need to be set once at engine > creation? And, would you expect the patch to go into the trunk at some > point? You can change the setting on the fly to some degree by varying the types in use - this means you'd create your own "Binary" type which either does or does not do the conversion. If you look at the source to OracleBinary, its pretty easy to do this. But this is not entirely "on the fly" since its associated with the type of construct in use, not a flag on the connection or execution context. If your app is sticking with the SQL construction language and not the ORM, you'd have to send expressions to your select() objects that affect the type. To really allow it to happen "on the fly" we'd have to probably include ExecutionContext as an argument to TypeEngine.result_processor() and allow some other flags to be passed to ExecutionContext somehow...its basically a lot of new API to add. For the time being there's not a really spectacular way to do this except for the boring ways (basically, run result rows through a function). If you're integrating with ORM theres other ways to get hooks in there, its sort of use case specific how you'd go about it. Another complication to keep in mind is the "arraysize" boundary - unless you turn the auto_convert_lobs flag back on, the ResultProxy you get back is not going to "pre-fetch" columns which means a fetchmany() or fetchall() might leave unread LOB objects which no longer have a cursor. I have a bunch of trac tickets that are all in "patch but no tests yet" format, so I hope to go through these within the next 7 days and hopefully by the weekend. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
